If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > cache value only for duration of database being up

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-13-09, 17:18
craigmc craigmc is offline
Registered User
 
Join Date: Aug 2003
Location: austin,tx
Posts: 90
cache value only for duration of database being up

Here's my problem. I need access to the system hostname from a function call. The only way I know to get the hostname is via this call:

select reg_var_value from table(sysproc.reg_list_variables()) as registryinfo WHERE reg_var_name = 'DB2SYSTEM'

Problem is the performance is not very good and I'm using this call in a lot of places (mostly for key generation).

If anyone can offer me a better way to get the hostname please do.

Otherwise.. I'm thinking I can just cache the fetched hostname in a local table so it only has to be fetched once. Problem there is that there is no guarantee that the hostname won't ever change. And if I just fill it on once I will miss this change. It would suffice if I could set/reset it every time the database was started. Anyone know a good way to do this? Maybe a temp table that lives for the duration of the database execution, or a way to have a script or command run at startup? Any other ideas?
Thanks.
btw, this will be on a 9.7 database..
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On