General expressions
Derby Reference Manual
88
Some locations allow only a specific type of expression or one with a specific property.
If not otherwise specified, an expression is permitted anywhere the word Expression
appears in the syntax. This includes:
·
·
·
·
·
Of course, many other statements include these elements as building blocks, and so
allow expressions as part of these elements.
The following tables list all the possible SQL expressions and indicate where the
expressions are allowed.
General expressions
General expressions are expressions that might result in a value of any type. The
following table lists the types of general expressions.
Table 2.
General expressions
Expression Type
Explanation
Column reference
A
that references the value of the column
made visible to the expression containing the Column
reference.
You must qualify the column-Name by the table name or
correlation name if it is ambiguous.
The qualifier of a column-Name must be the correlation
name, if a correlation name is given to a table that is in
a
. The table name is no longer visible as
a column-Name qualifier once it has been aliased by a
correlation name.
s, UPDATE statements, and
the WHERE clauses of data manipulation statements.
Constant
Most built-in data types typically have constants
associated with them (as shown in
NULL
NULL is an untyped constant representing the unknown
value.
Allowed in CAST expressions or in INSERT VALUES
lists and UPDATE SET clauses. Using it in a CAST
expression gives it a specific data type.
Dynamic parameter
A dynamic parameter is a parameter to an SQL
statement for which the value is not specified when
the statement is created. Instead, the statement has a
question mark (?) as a placeholder for each dynamic
parameter. See
.
Dynamic parameters are permitted only in prepared
statements. You must specify values for them before the
prepared statement is executed. The values specified
must match the types expected.