ALLBASE/SQL Reference Manual (36216-90216)

Chapter 8 247
Expressions
Date/Time Functions
ProcedureParameter
contains a value that is passed into or out of a procedure.
::
Built-inVariable
is one of the following built-in variables used for error handling:
::sqlcode
::sqlerrd2
::sqlwarn0
::sqlwarn1
::sqlwarn2
::sqlwarn6
::activexact
The first six of these have the same meaning that they have as fields in the
SQLCA in application programs. ::activexact indicates whether a
transaction is in progress or not. For additional information, refer to the
application programming guides and to Chapter 4 , “Constraints,
Procedures, and Rules.
Description
If the format specification is optional and it is not supplied, the proper default format is
used. If a date/time column or string literal appears in an expression without a
conversion function, it is changed, if necessary, to the default format.
Date format is used by the TO_DATE function and by the TO_CHAR function on DATE
expressions. The default format is 'YYYY-MM-DD'.
Listed here are format elements made up of numeric characters (digits 0 through 9):
CC Century (00 to 99)
YYYY Year (0000 to 9999)
YY Year of century (00 to 99)
ZYY YY with leading zeroes suppressed (0 to 99) (TO_CHAR only)
Q Quarter (1 to 4) (TO_CHAR only )
MM Month (01 to 12)
ZMM MM with leading zeroes suppressed (1 to 12) (TO_CHAR only)
DAYS Days since January 1, 0000 (0000000 to 3652436)
ZDAYS DAYS with leading zeroes suppressed (0 to 3652436) (TO_CHAR only)
DDD Day of year (001 to 366)
ZDDD DDD with leading zeroes suppressed (1 to 366) (TO_CHAR only)
DD Day of month (01 to 31)
ZDD DD with leading zeroes suppressed (1 to 31) (TO_CHAR only)
D Day of week (1 to 7) (TO_CHAR only)