Access the session environment

The session environment describes the current session, which includes the database server and open database that are in effect when the client application called the SQL statement that contains the UDR. The UDR obtains its session environment when it obtains a connection descriptor with the mi_open() function.

The following DataBlade® API functions provide information about the session environment of a UDR.
Session-environment information DataBlade API function
Connection parameters:
  • Name of the database server
  • Server port for a connection
mi_get_connection_info(), mi_get_default_connection_info()
Database parameters:
  • Name of the open database
  • Name of the account and password for the user that established the connection
mi_get_database_info(), mi_get_default_database_info()
Database options:
  • ANSI compliant
  • Transaction logging
  • Exclusive mode
mi_get_connection_option()
The session environment also includes the following locale information:
  • The server-processing locale, which the database server creates when the client application establishes a connection)
  • The server locale (which is the locale that the database server uses to read and write its own files)

You can obtain the name of the server locale from the connection-information descriptor (MI_CONNECTION_INFO) with the mi_get_connection_info() or mi_get_default_connection_info() function. For more information about these locales, see the Informix® GLS User's Guide.

Tip: You can use the mi_get_id() function to obtain the session identifier for the session. A session identifier uniquely identifies the session.