5. Using a Distributed Database : dbmsinfo( ) Function--Request Information from a Database
 
Share this page                  
dbmsinfo( ) Function--Request Information from a Database
The dbmsinfo( ) function is an SQL function that is used to request information from a database.
This function has the following syntax:
dbmsinfo (request_name)
Request names for the dbmsinfo function that are supported by Ingres Star are shown here:
Request Name
Response Description
autocommit_state
Returns 1 if autocommit is on; 0 if autocommit is off.
_bintim
Returns the current time and date in an internal format, represented as the number of seconds since January 1, 1970, 00:00:00 GMT.
_bio_cnt
Returns the number of I/Os made by Ingres Star and all currently connected local DBMSs. Ingres Star returns “0” for this argument.
_cpu_ms
Cpu time for session in milliseconds. Ingres Star returns 0 for this argument.
database
Returns the database name.
dba
User name of the distributed database owner.
dbms_bio
Returns the number of buffered I/O requests for all connected sessions. Ingres Star returns 0 for this argument.
dbms_cpu
Returns the cumulative CPU time for the local DBMS, in milliseconds, for all connected sessions. Ingres Star returns 0 for this argument.
dbms_dio
Returns the number of direct I/O requests for all connected sessions. Ingres Star returns 0 for this argument.
_dio_cnt
Disk I/O requests made by Ingres Star and all currently connected local DBMSs. Ingres Star returns 0 for this argument.
_et_sec
Returns the elapsed time for session, in seconds.
language
Returns the language used in the current session to display messages and prompts.
_pfault_cnt
Page fault count for Ingres Star and all currently connected local DBMSs. Ingres Star returns 0 for this argument.
query_language
Returns 'sql' or 'quel'.
server_class
Returns the class of local DBMS, for example 'ingres'.
terminal
Returns the terminal address.
transaction_state
Returns 1 if presently in a transaction, 0 if not.
username
User name of the client connected to Ingres Star.
_version
Current version number of the Ingres Star process.
These request names are case insensitive. When you run a query against an Ingres local DBMS, the dbmsinfo() function always returns a varchar(32) as the result. When you run a query against a Star Server, the dbmsinfo() function returns a varchar of the length of the response.
The following query returns a variable length string containing the answer, for example, 1:
select i=dbmsinfo(’transaction_state’);
For more information on dbmsinfo( ), see the SQL Reference Guide.