Initialize the library
Before you can use functions in your application, these functions must be able to access the current processing locale.
The ifx_gl_init() function initializes the current processing locale to the client locale. It creates a global locale structure that the functions can access to obtain the name of the current processing locale.
- ESQL/C applications establish their own connections to a database server and therefore must call the ifx_gl_init() function at the beginning of the main() program block to establish the client locale as the current processing locale.
- DataBlade® client applications establish their own connections to a database server and therefore must call the ifx_gl_init() function at the beginning of the main() program block to establish the client locale as the current processing locale.
- DataBlade® user-defined
routines (UDRs) execute in the context of an established connection
and therefore use the server-processing locale as their current processing
locale.
The database server uses a server-processing locale to obtain locale information for its own internal sessions and for any connections. It uses the values of the client locale, database locale, server locale, and other environment information to determine the server-processing locale. DataBlade® UDRs are not required to call the ifx_gl_init() function. For more information about the server-processing locale and how the database server establishes it, see the Informix® GLS User's Guide.
The ifx_gl_init() function does not generate an error if you call it multiple times within the same application. The first time that the application calls ifx_gl_init(), the function initializes the global locale structure. Subsequent calls do not result in multiple locale structures.