Scalable Database Server, HiRDB Version 8 SQL Reference

[Contents][Index][Back][Next]

1.5.4 Specifiable locations

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

Note 1
Embedded variables and indicator variables are specified in a UAP. The ? parameter should be specified in an SQL character string that is preprocessed by the PREPARE statement. SQL parameters in an external routine are specified in a parameter variable specification in the external routine with which they are associated. When a parameter for an external routine is passed to an SQL or a routine, it is specified as an embedded variable or a ? parameter rather than as an SQL parameter. An SQL variable cannot be specified in an external routine.

Note 2
Embedded variables, indicator variables, and ? parameters cannot be specified in selection expressions.
Embedded variables, indicator variables, and ? parameters can be specified in the following cases:
  • Specifying in a function call argument
  • Specifying in an argument of the SUBSTR scalar function
For specification methods, see 2.3 Query specification.

Note 3
Arithmetic or comparison operations cannot be specified between embedded variables, indicator variables, and ? parameters.

Note 4
Embedded variables, indicator variables, and ? parameters cannot be specified in an argument of a set function.

Note 5
Embedded variables, indicator variables, and ? parameters cannot be specified in an argument of the HEX scalar function.

Note 6
Embedded variables, indicator variables, or ? parameters cannot be specified singly (including specification in a unary operation expression) in an argument of a scalar function, with the exception of the second and third arguments of VALUE, BIT_AND_TEST, or SUBSTR, or in the third argument of POSITION. However, embedded variables, indicator variables, or ? parameters of the BLOB or BINARY type, and these types only, can be specified if the AS data type is specified in the first argument of SUBSTR, in an argument of LENGTH, or in the first or second argument of POSITION.

Note 7
Embedded variables, indicator variables, and ? parameters cannot be specified in a date, time, or concatenation operation.

Note 8
Embedded variables, indicator variables, and ? parameters cannot be specified singly in the first value expression of the VALUE scalar function (including specification in monomial operational expressions).

Note 9
Embedded variables, indicator variables, and ? parameters cannot be specified singly in the CASE, THEN, or ELSE value expression of a simple CASE expression or searched CASE expression (including specification in monomial operational expressions).

Note 10
Embedded variables, indicator variables, and ? parameters cannot be specified singly in the first WHEN value expression during simple CASE expression specification, the first value expression of COALESCE, or both value expressions of NULLIF (including specification in monomial operational expressions).

Note 11
Embedded variables, indicator variables, or ? parameters cannot be specified singly (including specification in a unary operation expression) in the two value expressions of the BIT_AND_TEST scalar function.

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.

2 When specifying an embedded variable, an indicator variable, or a ? parameter singly as an assignment value in an assignment statement (SET), you must always specify the AS data type.