Home | Previous Page | Next Page   Creating User-Defined Routines > Writing a User-Defined Routine > Accessing the UDR Execution Environment >

Accessing 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( )
Global Language Support

The session environment also includes the following locale information:

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 on these locales, see the IBM Informix: GLS User's Guide.

End of Global Language Support
Tip:
You can use the mi_get_id( ) function to obtain the session identifier for the session. A session identifier uniquely identifies the session.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]