informix
Informix DataBlade API Programmer's Manual
Writing a User-Defined Routine

Accessing the UDR Execution Environment

When the UDR obtains a UDR session, its execution environment is made up of the following:

Accessing the Session Environment

The session environment describes the current client 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
The connection parameters:
  • the name of the database server
  • the server port for a connection
  • mi_get_connection_info(), mi_get_default_connection_info()
    The database parameters:
  • the name of the open database
  • the 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:

    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 Informix Guide to GLS Functionality.

    Accessing the Server Environment

    The server environment describes the environment of the database server in which the UDR executes. The server environment is established when the database server is initialized with the oninit utility (or its equivalent). The operating-system process that runs the oninit utility (or its equivalent) is called the server-initialization process.

    The server environment includes the following information.

    Server-Environment Information How It Is Established
    Environment variables The environment variables set for the server-initialization process
    File-access permissions The file-access permissions of the server-initialization process
    Configuration parameters The ONCONFIG file that is current for the database server
    Working directory The working directory of the server-initialization process

    The server environment includes value of the SERVER_LOCALE environment variable, which can specify a nondefault server locale. Values of the DB_LOCALE and CLIENT_LOCALE environment variables in the server locale do not necessarily apply to the UDR. While it executes, a UDR obtains the client and database locales from the server-processing locale (which the database server creates when the client application establishes a connection). For more information on these locales, see the Informix Guide to GLS Functionality.

    The UDR obtains its server environment when it begins execution. You can obtain the values of the server-environment variables and a configuration parameters with the mi_get_serverenv() function.


    Informix DataBlade API Programmer's Manual, Version 9.2
    Copyright © 1999, Informix Software, Inc. All rights reserved