Previous Topic: DescriptionNext Topic: Example


Parameter Marker Replacement

Before the prepared statement is executed, host variables are assigned to target variables for each parameter marker. The attributes of the target variables depend on the role that the parameter marker plays in the SQL statement. The rules for these roles are shown in the following. In these rules, P represents the parameter marker in question.

Arithmetic Operand

When P is an operand of an infix operator, the data type, precision, and scale of the target variable is the same as the other operand, so both operands cannot be parameter markers.

When P is the operand of a unary minus, the data type of the target variable is double precision floating-point.

LIKE Predicate

If you specify the parameter marker as the pattern of a LIKE predicate (see LIKE Predicate), ensure that the host variable used to replace the parameter marker is compatible with the first operand.

Comparand

P can be a comparand in a BETWEEN, IN, or basic predicate, where at least one of the other comparands is not a parameter marker. The attributes of the target for P are those of one of the other comparands.

Assignment Operand

P must be the value assigned to a column in an INSERT or UPDATE statement. The attributes of the target are the same as the column.