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 > Getting DB2 version using SQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-18-05, 14:05
WhiZa WhiZa is offline
Registered User
 
Join Date: Feb 2002
Posts: 58
Getting DB2 version using SQL

How do I get the version of DB2 I'm using? I know you can use db2level on unix, but is there anyway to pass SQL to return it? Thanks
Reply With Quote
  #2 (permalink)  
Old 10-19-05, 03:23
Peter.Vanroose Peter.Vanroose is offline
Registered User
 
Join Date: Sep 2004
Location: Belgium
Posts: 1,079
In analogy with CURRENT TIMESTAMP etc., I would have expected something like CURRENT VERSION;
I searched the man pages for this but did not find anything, so it seems like this is not possible with SQL ...

With embedded SQL, it seems to be possible to get the DB2 version, through the SQLERRP field of the SQLCA.

From the man page:
"If the server is an IBM relational database product, this information has the form pppvvrrm, where:
* ppp is ARI (DB2 Server for VSE&VM), DSN (DB2 for MVS), QSQ (OS/400) or SQL (all others)
* vv is a two-digit version identifier such as '07'.
* rr is a two-digit release identifier such as '01'.
* m is a one-digit modification level such as '0'.
For example, if the server is Version 7 of DB2 for OS/390 and z/OS with the latest maintenance, the value of SQLERRP is 'DSN07011'."

Last edited by Peter.Vanroose; 10-19-05 at 03:30.
Reply With Quote
  #3 (permalink)  
Old 10-19-05, 12:03
bmujeeb bmujeeb is offline
Registered User
 
Join Date: Mar 2004
Posts: 448
db2 version 8.2.1 have introduced some new procedures.

http://www-128.ibm.com/developerwork...dm-0505melnyk/

regards,

mujeeb
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