Generates a call to set the application name on the global CS_CONTEXT handle. If precompiled with the -x option, it will also set the cs_config(CS_SET, CS_EXTERNAL_CONFIG, CS_TRUE) property.
exec sql initialize_application [application_name “=” application_name];
exec sql include sqlca;
main()
{
exec sql initialize_application
application_name = :appname;
/*
** The body of the main function goes here,
** including various Embedded SQL statements.
*/
...
/* The init statement must be the first
** embedded SQL statement in the program.
*/
exec sql exit;
} /* end of main */
application_name is either a literal string or a character variable containing the name of the application.
If initialize_application is the first Embedded SQL statement executed by an application, -x causes ct_init to use external configuration options to initialize the Client-Library part of the CS_CONTEXT structure.
If initialize_application is not the first Embedded SQL statement, ct_init does not pick up external configuration options.
Regardless of whether or not initialize_application is the first Embedded SQL statement, -x causes exec sql connect statements to use external configuration data. If -e is also specified, Sybase uses the server name as a key to the configuration data. If -e is not specified, then the application name (or DEFAULT) is used as the key to the configuration data.
If you specify -x and the application name, the following applies:
ct_init uses the application name to determine which section of the external configuration file to use for initialization.
The application name is passed to Adaptive Server as part of the connect statement. The application name is entered in the sysprocesses.program_name table.
If -e is specified without -x, then ct_init will use external configuration data when initializing, but every connection will use the server name as a key to the external configuration data. See the Open Client/Server Programmer’s Supplement for information on command-line options.
exit