Using the 'version' Option

You can use the 'version' option of the DBINFO function to retrieve information from the message log about the type and release version of the database server against which the client application is running.

You must include a 'parameter' specification after the 'version' option to indicate which part of the version string you want to retrieve.

If after 'version' you specify 'full' as the parameter value, DBINFO returns the complete version string, which is the same value that the -V option of the oninit utility displays. The following table lists all the valid parameter arguments toDBINFO that can retrieve version information about the database server:
  • The Arguments column shows the parentheses-delimited argument list of each valid DBINFO ( 'version', 'parameter') combination.
  • The Part of Version String Returned column shows which part of the version string each Arguments list returns.
  • The Example of Returned Value column shows gives an example of what is returned by each value of parameter for the Arguments option.
Each example returns part of the complete version string Informix® Version 11.50.UC6.
Arguments Part of Version String Returned Example of Returned Value
('version', 'server-type') Type of database server Informix
('version', 'major') Major version number of the current database server version 11
('version', 'minor') Minor version number of the current database server version 50
('version', 'os') Operating-system identifier within the version string:
  • T = 32-bit Windows platforms
  • U = UNIX 32-bit running on a 32-bit operating system
  • H = UNIX 32-bit running on a 64-bit operating system
  • F = All 64-bit platforms
U
('version', 'level') Interim release level of the current database server version C6
('version', 'full') Complete version string as it would be returned by oninit -V Informix, Version 11.50.UC6
Important: Not all UNIX environments fit the word-length descriptions of operating- system (os) codes in the preceding table. For example, some U versions can run on 64-bit operating systems. Similarly, some F versions can run on operating systems with 32-bit kernels that support 64-bit applications.
The following example shows how to use the 'version' option of DBINFO in a SELECT statement to retrieve the major version number of the database server that the DB-Access client is connected to:
SELECT DBINFO('version', 'major')
   FROM systables
   WHERE tabid = 1;
The following table shows the result of this query.
(constant)
7