Set the OPTMSG environment variable

The OPTMSG environment variable enables the optimized message transfers for all SQL statements in the application.

You can assign the following values to the OPTMSG environment variable:
1
This value enables optimized message transfers, implementing the feature for any connection that is after.
0
This value disables optimized message transfers. (Default)

The default value of the OPTMSG environment variable is 0. Setting OPTMSG to 0 explicitly disables message chaining. You might want to disable optimized message transfers for statements that require immediate replies, or for debugging purposes.

To enable optimized message transfers, you must set OPTMSG before you start the application.

On UNIX™ operating systems, you can set OPTMSG within the application with the putenv() system call (as long as your system supports the putenv() function). The following call to putenv(), for example, enables optimized message transfers:
putenv("OPTMSG=1");
In Windows™ environments, you can set OPTMSG within the application with the ifx_putenv() function. The following call to ifx_putenv(), for example, enables optimized message transfers:
ifx_putenv("OPTMSG=1");

When you set OPTMSG within an application, you can activate or deactivate optimized message transfers for each connection or within each thread. To enable optimized message transfers, you must set OPTMSG before you establish a connection.