logo  
Google
 

DB2 SQL-Error: -312

SQLState: 42618

Short Description: VARIABLE IS NOT DEFINED OR NOT USABLE

The variable variable-name appears in the SQL statement, but one of the following conditions exists: v No declaration for the variable exists. v The attributes of the variable are inconsistent with its usage in the SQL statement. v The host variable was specified in a dynamic SQL statement. Host variables are not valid in dynamic SQL statements. v A host variable array is used in a context in which it is not allowed. See DB2 SQL Reference for information on where host variable arrays are allowed. v The variable appeared in one of the triggered SQL statements in a CREATE TRIGGER statement. An OLD transition variable cannot be modified in a trigger body. v The variable name is used in the body of an SQL procedure (CREATE or ALTER PROCEDURE statement), but the variable is not declared as an SQL variable or parameter. The scope of the SQL variable is the compound statement that contains the declaration, including any compound statements that are nested within that compound statement. v The variable appeared in one of the key-expressions of an index definition.System action: The statement cannot be processed. Programmer response: Do one of the following solutions and try the request again: v Verify that the program or SQL routine contains a declaration for the variable. Check to see that the variable name is spelled correctly in the SQL statement. v Verify that the attributes of the variable are compatible with its use in the statement. v Use parameter markers in a dynamic SQL statement instead of host variables. v Specify a NEW transition variable when the variable is modified in a trigger. v Declare the variable as an SQL variable or parameter in the SQL procedure. v Check the definition of the index and remove any host variables that are specified.

 <-  BACK TO INDEX