The Dbmsinfo() Function
Dbmsinfo() is a function that returns a string containing information about the current session. You can use this statement in the Terminal Monitor or in an embedded QUEL application. The dbmsinfo() statement has the following syntax:
dbmsinfo("request_name")
For example, to find out which release of Ingres you are using, enter:
retrieve (x=dbmsinfo("_version"))
The following lists valid request_names:
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 to and from the front-end client (application) that created your session.
collation
Returns the collation sequence defined for the database associated with the current session. This returns blanks if the database is using the collation sequence of the machine's native character set, such as ASCII or EBCDIC.
_cpu_ms
Returns the CPU time for your session, in milliseconds
create_procedure
Returns "Y" if the session has create_procedure privileges in the database or "N" if the session does not
create_table
Returns "Y" if the session has create_table privileges in the database or "N" if the session does not
cursor_deferred_update
Returns "Y" if the default cursor mode is deferred; "N" otherwise. The default cursor mode is specified when the DBMS Server is started.
cursor_direct_update
Returns "Y" if the default cursor mode is direct; "N" otherwise. The default cursor mode is specified when the DBMS Server is started.
database
Returns the database name
dba
Returns the user name of the database owner
db_admin
Returns "Y" if the session has the db_admin privilege
dbms_bio
Returns the number of buffered I/O requests for all connected sessions
dbms_cpu
Returns the cumulative CPU time for the DBMS Server, in milliseconds, for all connected sessions
dbms_dio
Returns the number of direct I/O requests for all connected sessions
db_delimited_case
Returns "LOWER" if delimited identifiers are translated to lower case, "UPPER" if delimited identifiers are translated to upper case, or "MIXED" if the case of delimited identifiers is not translated. For details about delimited identifiers, see the SQL Reference Guide.
db_name_case
Returns "LOWER" if regular identifiers are translated to lower case, or "UPPER" if regular identifiers are translated to upper case
_dio_cnt
Returns the number of disk I/O blocks for your session
_et_sec
Returns the elapsed time for session, in seconds
flatten_aggregate
Returns "Y" if the DBMS Server is configured to flatten queries involving aggregate subselects; "N" otherwise. (Query flattening options are specified when the DBMS Server is started.)
flatten_none
Returns "Y" if query flattening is disabled. (Query flattening options are specified when the DBMS Server is started.)
flatten_optimize
Returns "Y" if the DBMS Server is configured to flatten queries wherever possible; "N" otherwise. (Query flattening options are specified when the DBMS Server is started.)
flatten_singleton
Returns "Y" if the DBMS Server is configured to flatten queries involving singleton subselects; "N" otherwise. (Query flattening options are specified when the DBMS Server is started.)
group
Returns the session's group identifier or blanks if no group identifier is in effect
initial_user
Returns the user identifier in effect at the start of the session
language
Returns the language used in the current session to display messages and prompts
lockmode
Returns "Y" if the session can issue the set lockmode statement or "N" if the session cannot
maxio
Returns the value specified in the last set maxio statement. If no previous set maxio statement was issued or if set nomaxio was specified last, this returns the same value as the request name query_io_limit.
maxquery
Same as maxio
maxrow
Returns the value specified in the last set maxrow statement. If no previous set maxrow statement was issued or if set nomaxrow was specified last, this returns the same value as the request name query_row_limit.
on_error_state
Returns the current setting for transaction error handling: "rollback transaction" or "rollback statement". To set transaction error handling, use the set session with on_error statement.
_pfault_cnt
Returns the number of page faults for server
query_io_limit
Returns the session's value for query_io_limit or -1 if no limit is defined for the session
query_language
Returns "sql" or "quel"
query_row_limit
Returns the session's value for query_row_limit or -1 if no limit is defined for the session
role
Returns the session's role identifier or blanks if no role identifier is in effect
security_audit_log
Returns the name of the current security auditing log file. For details about security auditing, see the SQL Reference Guide.
security_priv
Returns "Y" if the effective user has the security privilege, or "N" if the effective user does not have the security privilege
server_class
Returns the class of DBMS server, for example "ingres"
session_id
Returns the internal session identifier in hexadecimal
session_user
Returns the session's current effective user ID
system_user
Returns the system user ID
terminal
Returns the terminal address
transaction_state
Returns 1 if presently in a transaction, 0 if not
update_rowcnt
Returns "qualified" if inquire_ingres(rowcount) returns the number of rows that qualified for change by the last query, or "changed" if inquire_ingres(rowcount) returns the number of rows that were actually changed by the last query. For details, see
Update_rowcount Option.
update_syscat
Returns "Y" if the effective user is allowed to update system catalogs, or "N" if the effective user is not allowed to update system catalogs
username
Returns the session's current effective user ID
_version
Returns the DBMS version number