Serge Rielau wrote:
sb****@gmail.co m wrote: Hi,
who could tell me if there is a SYSIBM table that would give me the
current db2 version accessed (on MVS) - i.e. Oracle offers a v$version
system table that gives that information.
Thanks
Jean-Louis
Take a look in the sqludf include file.
The dbinfo structure has a ver_rel attribute.
It should be available on all platforms
You can write an external UDF which grabs the result.
The following (untested code) should work, at least on LUW. But I'd be a
bit surprised if it would not work on zOS or MVS.
--------------- Java code -------------------
public class extends DB2Version extends COM.ibm.db2.app .UDF
{
public void getVersion(Stri ng version)
{
set(1, getDBver_rel()) ;
}
}
--------------- SQL CREATE FUNCTION -------------------
CREATE FUNCTION getDB2Version()
RETURNS VARCHAR(8)
LANGUAGE JAVA
PARAMETER STYLE DB2GENERAL
EXTERNAL NAME 'DB2Version!get Version'
DETERMINISTIC
NO EXTERNAL ACTION
DBINFO
@
--
Knut Stolze
Information Integration Development
IBM Germany / University of Jena