1.1.1

Table Of Contents
7. Use on either or both sides of LIKE operator is permitted. When used on the left, the type of the dynamic
parameter is set to the type of the right operand, but with the maximum allowed length for the type. When
used on the right, the type is assumed to be of the same length and type as the left operand. (LIKE is permitted
on CHAR and VARCHAR types)
WHERE ? LIKE 'Santi%'
-- type assumed to be CHAR with a length of
-- java.lang.Integer.MAX_VALUE
8. A ? parameter is allowed by itself on only one side of the || operator. That is, "? || ?" is not allowed. The type
of a ? parameter on one side of a || operator is determined by the type of the expression on the other side of
the || operator. If the expression on the other side is a CHAR or VARCHAR, the type of the parameter is
VARCHAR with the maximum allowed length for the type. If the expression on the other side is a CHAR
FOR BIT DATA or VARCHAR FOR BIT DATA type, the type of the parameter is VARCHAR FOR BIT
DATA with the maximum allowed length for the type.
SELECT BITcolumn || ?
FROM UserTable
-- Type assumed to be CHAR FOR BIT DATA of length specified for BITcolumn
9. In a conditional expression, which uses a ?, use of a dynamic parameter (which is also represented as a ?) is
allowed. The type of a dynamic parameter as the rst operand is assumed to be boolean. Only one of the
second and third operands can be a dynamic parameter, and its type will be assumed to be the same as that
of the other (that is, the third and second operand, respectively).
SELECT c1 IS NULL ? ? : c1
-- allows you to specify a "default" value at execution time
-- dynamic parameter assumed to be the type of c1
-- you cannot have dynamic parameters on both sides
-- of the :
10. A dynamic parameter is allowed as an item in the values list or select list of an INSERT statement. The type
of the dynamic parameter is assumed to be the type of the target column.
INSERT INTO t VALUES (?)
-- dynamic parameter assumed to be the type
-- of the only column in table t
INSERT INTO t SELECT ?
FROM t2
-- not allowed
11. A ? parameter in a comparison with a subquery takes its type from the expression being selected by the
subquery. For example:
SELECT *
FROM tab1
WHERE ? = (SELECT x FROM tab2)
SELECT *
FROM tab1
WHERE ? = ANY (SELECT x FROM tab2)
-- In both cases, the type of the dynamic parameter is
vFabric SQLFire User's Guide550
vFabric SQLFire Reference