Using the 'onedb' Option

You can use the 'onedb' 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 'onedb' option to indicate which part of the version string you want to retrieve.

If after 'onedb' 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 ( 'onedb', '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 HCL OneDB™ Server 1.0.0.0.
Arguments Part of Version String Returned Example of Returned Value
('version', 'major') Major version number of the current database server version 1
('version', 'minor') Minor version number of the current database server version 0
('version', 'full') Complete version string as it would be returned by oninit -V HCL OneDB Server 1.0.0.0
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('onedb', 'major')
   FROM systables
   WHERE tabid = 1;
The following table shows the result of this query.
(constant)
1