Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2002

    Unanswered: 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

  2. #2
    Join Date
    Sep 2004
    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 04:30.

  3. #3
    Join Date
    Mar 2004
    db2 version 8.2.1 have introduced some new procedures.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts