Determining Parameter Marker Data Types

When you use a parameter marker, ESQL determines a default data type for the parameter marker from the context in which the parameter marker appears. In general, ESQL assumes for any dynamic parameter marker that is an operand of a binary arithmetic or comparison operator, that its data type is the same as the other operand of the operator. For example, the dynamic parameter marker in this expression has the same data type as the 5, INTEGER (SQLDAINT):

... WHERE cust\-num = 5 + ? ... 

Table 2–14 lists the default parameter marker data types in different statement locations.

Table 2–14: Default Parameter Marker Data Types
Location of Dynamic
Parameter Marker
Default
Data Type
An operand of a binary arithmetic or comparison operator.
Same as the other operand.
BETWEEN — first operand.
Same as the second operand.
BETWEEN — second or third operand.
Same as the first operand.
IN — expression.
Same as either the first value or the result column of the subquery.
IN — value.
Same as the expression.
Expression in quantified predicate.
Same as the result column of the subquery.
INSERT — column value.
Same as the inserted column.
LIKE — pattern value.
CHARACTER (SQLDACHAR).
LIKE — ESCAPE character.
CHARACTER (SQLDACHAR).
UPDATE — column value.
Same as the updated column.

If you cannot determine the data type of a dynamic parameter marker based on the rules identified in this table, the dynamic parameter marker is invalid. For example, the following expression is invalid:

... WHERE cust\-num = ? + ? ... 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095