The command line process command BIND contains the GENERIC parameter. The GENERIC parameter specifies a string that contains any option-value pairs. Each option and value must be separated by one or more blank spaces. The syntax for this string is displayed as follows:
GENERC 'option1 value1 option2 value2 '
This option applies a multiplier to CHAR and VARCHAR host variables. It is also expand character host variable lengths within database server to accomdate code page conversion expansion in unequal codepage environment.
You should use this string in order to resolve -302 errors occurring in static SQL applications running in unequal codepage environments even after table definitions increased to accommodate expansion. This is because static SQL by default uses the defined length of the host variable provided by the client during BIND to size the equivalent database server memory location for the variable.
bind myapp GENERIC HV_EXPANSION_FACTOR 2
To force the database to allocate 2 times the defined application length for the server representation of the variable. So in this example the 4 byte variable becomes 8 bytes in the database server. This enables the string nio on expansion to 5 bytes in UTF-8, so it still fits in the memory available to the variable
You can set the DB2® database manager to store all statements in the catalogs and marks them as incremental bind. To achieve this setting, the STATICASDYNAMIC YES string must be set for the GENERIC BIND command option.
At run time, when the package is first loaded, the database manager uses the current session environment (rather than the package) to set up the section entries and other entities (text is populated and the package cache is accessed).
DB2 BIND filename GENERIC 'STATICASDYNAMIC [YES|NO]'