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 > Database Name

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-20-05, 17:07
tuvarsha tuvarsha is offline
Registered User
 
Join Date: Dec 2005
Posts: 39
Database Name

I am using DB2 UDB for LUW. I have been trying to search for a query that can retrieve the database name, but in vain. Does anyone have any idea about it? Thanks!
Reply With Quote
  #2 (permalink)  
Old 12-20-05, 17:11
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
It depends on what DB2 version you are using. You can try the CURRENT SERVER special register.

SELECT CURRENT SERVER from sysibm.sysdummy1

Andy
Reply With Quote
  #3 (permalink)  
Old 12-20-05, 17:22
tuvarsha tuvarsha is offline
Registered User
 
Join Date: Dec 2005
Posts: 39
Thanks! It worked! I am using 8.1.10 (fixpak 10).
Reply With Quote
  #4 (permalink)  
Old 12-20-05, 17:23
tuvarsha tuvarsha is offline
Registered User
 
Join Date: Dec 2005
Posts: 39
You have replied to my posts earlier regarding retrieval of hostname (servername). I am just wondering, is there any other query other than selecting from table(SYSPROC.ENV_GET_SYS_INFO()), to retrieve the hostname?
Reply With Quote
  #5 (permalink)  
Old 12-21-05, 08:57
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
No. If after all the advice you have gotten from this forum and the ibm.software.db2.udb usenet forum you are still unable to use that function, I suggest you contact IBM Support to determine why.

Andy
Reply With Quote
  #6 (permalink)  
Old 12-21-05, 11:25
tuvarsha tuvarsha is offline
Registered User
 
Join Date: Dec 2005
Posts: 39
This forum is better than ibm db2 forum. I used to post there, but it used to take ages before I got replies in the past. Yeah, I got all the advice. And I have been searching on google too. But I am getting the same info. And since I dont know anything about DB2 and its background functionality, implementation, its making my work to find the solution more harder.

I have this doubt in mind. Does the problem I have has something to do with the DB2 database version on server? Because, I installed the 8.1.8 version of DB2 Admin Client and I did all the necessary steps, but it didnt seem to work. So, is it like if the version of the actual database is different, even though we install the latest version on the client side, still it would be of no use?
Reply With Quote
  #7 (permalink)  
Old 12-21-05, 11:41
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Yes, the server must be at FP 9 or higher to use that function. The client is irrelevant when issuing SQL that uses functions. The functions reside only on the server.

You need to upgrade the server to FP 10.

Andy
Reply With Quote
  #8 (permalink)  
Old 12-21-05, 11:44
tuvarsha tuvarsha is offline
Registered User
 
Join Date: Dec 2005
Posts: 39
Thanks a lot! How can I find the documentation to find out the version of the server and to upgrade the server to FP 10?
Reply With Quote
  #9 (permalink)  
Old 12-21-05, 11:45
tuvarsha tuvarsha is offline
Registered User
 
Join Date: Dec 2005
Posts: 39
Correction:

"how can I find.. = 'where' can I find.."
Reply With Quote
  #10 (permalink)  
Old 12-21-05, 11:47
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
run db2level on the server, that will give the DB2 version. Look in the other thread on where to download the FP.

Andy
Reply With Quote
  #11 (permalink)  
Old 12-21-05, 11:57
tuvarsha tuvarsha is offline
Registered User
 
Join Date: Dec 2005
Posts: 39
I ran db2level from the command window of the Control Center. It just gave the same info. as that of the db2 admin client. Guess I ran the command on the client. How to run it on the server?
Reply With Quote
  #12 (permalink)  
Old 12-21-05, 12:02
tuvarsha tuvarsha is offline
Registered User
 
Join Date: Dec 2005
Posts: 39
It gave the following info:

DB21085I Instance "DB2" uses "32" bits and DB2 code release "SQL08021" with
level identifier "03020106".
Informational tokens are "DB2 v8.1.8.762", "s041221", "WR21348", and FixPak
"8".
Product is installed at "C:\sqllib".
Reply With Quote
  #13 (permalink)  
Old 12-21-05, 12:04
tuvarsha tuvarsha is offline
Registered User
 
Join Date: Dec 2005
Posts: 39
Isnt it okay to use FixPak 8?? Because as far as I know, I believe, the upgradations have been done from FixPak 8.
Reply With Quote
  #14 (permalink)  
Old 12-21-05, 12:19
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
To get db2level info from server:

1) goto the server (forget the client pc)
2) from the db2 command window ON THE SERVER run db2level.

THE FUNCTION YOU ARE TRYING TO EXECUTE WAS NOT INTRODUCED UNTIL FP 9. IT DOES NOT EXIST PRIOR TO THAT.

Andy
Reply With Quote
  #15 (permalink)  
Old 12-21-05, 12:27
tuvarsha tuvarsha is offline
Registered User
 
Join Date: Dec 2005
Posts: 39
Ok. One more dumb doubt. I know I must be sounding like a fool , but cant help it!! You said "go to server". But I dont know how to do that! I dont know how to go to the DB2 server and open it's command window.
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