Chat now with support
Chat with Support

SQL Optimizer for DB2 LUW 4.4 - Release Notes

Local Variables Conversion

The local variable conversion finds SQL statements that are found in the application source code on one command line and also contain at least one "local variable" which will be replaced by the application before the SQL statement is sent to the server. The SQL Scanner precedes the variable name with "&" and removes the concatenate character and the quotes surrounding the SQL text.  

Original SQL statement

"SELECT " + VEMPID + " FROM EMPLOYEE WHERE EMP_ID > 100"

After conversion

SELECT &VEMPID

  FROM EMPLOYEE

 WHERE EMP_ID > 100

Note: Each local variable in a scanned SQL statement may be replaced with a value or leave the variable in the SQL statement. The SQL Scanner uses "&" to differentiate the local variables from the host variables. The &variablename is not valid syntax for a SQL statement but the program will recognize this format and prompt you to input a value for the variable when needed to execute the SQL statement.

 

Related Topics

Related Documents

The document was helpful.

Select Rating

I easily found the information I needed.

Select Rating