Table 1-14 shows the SQL statement locations at which embedded variables, indicator variables, ? parameters, SQL variables, and SQL parameters can be specified.
Table 1-14 Specifiable locations of variables and parameters
SQL statement | Specifiable locations | Embedded variable | Indicator variable | ? Parameter | SQL variable or parameter |
---|---|---|---|---|---|
WRITE specification | 1st argument | N | N | N | N |
2nd argument, 3rd argument | Y | Y | Y | N | |
GET_JAVA_STORED_ROUTINE_SOURCE specification | 1st argument, 2nd argument | Y | Y | Y | Y |
3rd argument | N | N | N | N | |
DECLARE CURSOR | Anywhere in a search condition where a literal is allowed1 | Y | Y | N | Y |
ALLOCATE CURSOR Format 1 | Extended cursor name | Y | N | N | N |
Extended statement name | Y | N | N | N | |
ALLOCATE CURSOR Format 2 | Extended cursor name | Y | N | N | N |
SELECT | Anywhere in a search condition where a literal is allowed | Y | Y | Y | Y |
INTO clause | Y | Y | N | Y | |
INSERT | Anywhere in a VALUES clause where a literal is allowed | Y | Y | Y | Y |
Anywhere in a search condition where a literal is allowed | Y | Y | Y | Y | |
UPDATE | Anywhere in a SET clause where a literal is allowed | Y | Y | Y | Y |
Anywhere in a search condition where a literal is allowed | Y | Y | Y | Y | |
Preparable dynamic UPDATE statement: locating | Positions where a literal can be specified using a SET clause | N | N | Y | N |
DELETE | Anywhere in a search condition where a literal is allowed | Y | Y | Y | Y |
OPEN | USING clause | Y | N | N | N |
FETCH | INTO clause | Y | Y | N | Y |
PREPARE | Anywhere an SQL character string is allowed | Y | N | N | N |
DEALLOCATE PREPARE | Extended statement name | Y | N | N | N |
DESCRIBE | Extended statement name | Y | N | N | N |
DESCRIBE CURSOR | Extended cursor name | Y | N | N | N |
DESCRIBE TYPE | Extended statement name | Y | N | N | N |
EXECUTE | INTO clause | Y | Y | N | N |
USING clause | Y | Y | N | N | |
Extended statement name | Y | N | N | N | |
EXECUTE IMMEDIATE | Anywhere an SQL character string is allowed | Y | N | N | N |
INTO clause | Y | Y | N | N | |
USING clause | Y | Y | N | N | |
CALL | Argument | Y | Y | Y | Y |
Assignment statement | Assignment destination and assigned value | Y2 | Y | Y2 | Y |
FREE LOCATOR | See Locator | Y | N | N | N |
CONNECT | Authorization identifier and password | Y | N | N | N |
CONNECT statement with RD-node specification | RD-node name | Y | N | N | N |
DISCONNECT statement with RD-node specification | RD-node name | Y | N | N | N |
SET CONNECTION statement | RD-node name | Y | N | N | N |
SET SESSION AUTHORIZATION statement | Authorization identifier and password | Y | N | N | N |
ALLOCATE CONNECTION HANDLE | PDCNCTHDL-type variable, return code-receiving variable; connection PDHOST variable, and connection PDNAMEPORT variable | Y | N | N | N |
FREE CONNECTION HANDLE | PDCNCTHDL-type variable, and return code-receiving variable | Y | N | N | N |
DECLARE CONNECTION HANDLE SET | PDCNCTHDL-type variable | Y | N | N | N |
GET DIAGNOSTICS | Statement information item name, condition information item name | Y | N | N | N |
WRITE LINE statement | value expression | N | N | N | Y |
Y: Specifiable
N: Not specifiable
1 Excludes the search condition of a CASE expression in a selection expression.
When a cursor declaration is specified in a function call argument, the function call can be specified in a search condition in the CASE expression of the selection expression.