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 > Help - Need to get DB2 version info via SQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-16-07, 14:30
ChrisNees ChrisNees is offline
Registered User
 
Join Date: Mar 2007
Location: New York City
Posts: 2
Help - Need to get DB2 version info via SQL

I'm hoping someone can help me determine the DB2 version running on an MVS host. I have access to the DB2 panels and spufi but have not been able to determine anything more than it is version 7 or later (SYSIBM.SYSCOLDIST_HIST is present and populated).

I tried something I found on the db2luw site but no luck:

SELECT service_level, fixpack_num FROM TABLE
(sysproc.env_get_inst_info())
as INSTANCEINFO"

SQL0440N No function by the name "SYSPROC.ENV_GET_INST_INFO" having compatible arguments was found in the function path. SQLSTATE=42884


Thanks in advance,

Chris

Last edited by ChrisNees; 03-16-07 at 15:42.
Reply With Quote
  #2 (permalink)  
Old 03-19-07, 04:38
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
Try to issue a -DIS GROUP command.

you'll see something like this:
BEGIN DISPLAY OF GROUP(xxxxx ) GROUP LEVEL(810) MODE(N)

GROUP LEVEL is the DB2 - version
MODE is the modus: C=compatibility mode, N=new funcion mode, E=enabling new funcion mode
Reply With Quote
  #3 (permalink)  
Old 03-19-07, 10:29
ChrisNees ChrisNees is offline
Registered User
 
Join Date: Mar 2007
Location: New York City
Posts: 2
Thanks but I need SQL solution

Thanks but I don't have access to any DBA utilities. I'm barred by RACF from issuing even display commands. It looks like I'm limited to SQL.

Last edited by ChrisNees; 03-19-07 at 11:03.
Reply With Quote
  #4 (permalink)  
Old 03-20-07, 02:29
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
Then try to access table SYSIBM.SYSDUMMYE
( By default that table is created in V8 Compatibility mode ).

If it exists, you are in V8.

Next access SYSIBM.SYSTABLES
if NAME and CREATOR are both VARCHAR(128), then that DB2 is V8 NFM,
otherwise NAME is VARCHAR(18) and CREATOR is CHAR(8)


Another approach:
Try any SQL, that's valid in V8 NFM only.
e.g.
SELECT IBMREQD, ( SELECT IBMREQD FROM SYSIBM.SYSDUMMY1 )
FROM SYSIBM.SYSDUMMY1

If you receive an syntax error, that DB2 is V7,
if you receive SQLCODE -4700, that DB2 is V8 CM,
if execution is successfull, that DB2 is V8 NFM.

( caution: that does not work, if you are INSTALL SYSADM. Those users do not get SQLCODE -4700, but may execute that statements in V8 CM )

Last edited by umayer; 03-20-07 at 03:07.
Reply With Quote
  #5 (permalink)  
Old 03-20-07, 02:53
meehange meehange is offline
Registered User
 
Join Date: Jul 2004
Posts: 256
I just ran

Code:
SELECT service_level, fixpack_num FROM TABLE (sysproc.env_get_inst_info()) as x
and it returned the correct information. I couldn't get your code to work (I only changed the INSTANCEINFO" to an x)

So if you can't run what I just ran then I think that suggests you are on v7 as that stored proc is new to 8.....
Reply With Quote
  #6 (permalink)  
Old 03-20-07, 03:05
umayer umayer is offline
Registered User
 
Join Date: Dec 2005
Posts: 273
@ meehange,

you ran that statement on DB2 for z/OS ?

I receive an error when I try to execute it.
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