ALLBASE/SQL Reference Manual (36216-90216)

246 Chapter8
Expressions
Date/Time Functions
be a CHAR or VARCHAR data type.
DateTimeExpression
is a Date/Time expression. See the "Expression" section of
this chapter for more details on the syntax. The expression
must be a DATE, TIME, DATETIME, or INTERVAL data
type.
FormatSpecification
specifies the format of
ColumnName
or
CharacterValue
.
Refer to the syntax for
FormatSpecification
later in
this section. Format elements are presented in the
"Description" section below.
SQL Syntax—FormatSpecification
{‘FormatString’
:
HostVariable
[[INDICATOR]:
IndicatorVariable
]
?
:
LocalVariable
:
ProcedureParameter
::
Built-inVariable
}
Parameters—FormatSpecification
FormatString
is a character string literal representing the format of
DateTimeExpression
or
StringExpression
. It must be a string literal,
of maximum length 72 characters. Format is composed of one or more
elements. Available format elements for the date/time data types are
described below. Only n-computer characters are allowed in the
FormatString
. The syntax for the format string follows:
{
FormatElement
{
Punctuation or Blank
} [...] }
The format elements are listed in the "Description" section.
HostVariable
identifies a host variable that contains the format specification which
determines how the
DateTimeExpression
or
StringExpression
is to
be converted.
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.