ALLBASE/SQL Reference Manual (36216-90216)
Chapter 8 229
Expressions
Expression
Parameters
+, − designate unary plus and unary minus. Unary plus assigns the primary a
positive value. Unary minus assigns the primary a negative value. Default
is positive.
ColumnName
is the name of a column from which a value is to be taken; column names
are defined in the "Names" chapter.
USER The keyword USER can be used as a character constant in several
locations as follows:
• In a WHERE clause predicate when comparing it to a character string,
for example:
WHERE Owner = USER
WHERE Owner IN ('ALLUSERS', USER)
• In the VALUES clause of the INSERT statement, for example:
VALUES (USER)
• In a DEFAULT clause of a column definition, for example:
Owner CHAR(20) DEFAULT USER NOT NULL
• In a SELECT list, returning a character string, for example:
SELECT USER, column1
• In an UPDATE SET clause, assigning a value to a character string, for
example:
SET Owner = USER
USER evaluates to the current DBEUserID. In ISQL, it evaluates to the
login name of the ISQL user. From an application program, it evaluates to
the login name running the program. USER behaves like a CHAR(20)
constant, with trailing blanks if the login name has fewer than 20
characters.
Note that if a column in your table is named USER, it must be preceded
with the table name for column values to be selected. The function USER
takes precedence over any column named USER.
HostVariable
contains a value in an application program being input to the expression.
IndicatorVariable
names an indicator variable, whose value determines whether the
associated host variable contains a NULL value:
> = 0 the value is not NULL
< 0 the value is NULL (The value in the host variable will be
ignored.)
? is a place holder for a dynamic parameter in a prepared SQL statement in
an application program. The value of the dynamic parameter is supplied at
run time.
LocalVariable
contains a value in a procedure.