SQL Reference
>>-TIMESTAMP--(--expression--+-------------+--)----------------><
'-,expression-'
The schema is SYSIBM.
The TIMESTAMP function returns a timestamp from a value or a pair of
values.
The rules for the arguments depend on whether the second argument is
specified.
- If only one argument is specified:
- It must be a timestamp, a valid character string representation of a
timestamp, or a character string of length 14 that is neither a CLOB nor a
LONG VARCHAR.
A character string of length 14 must be a string of digits that represents
a valid date and time in the form yyyyxxddhhmmss, where
yyyy is the year, xx is the month, dd is the
day, hh is the hour, mm is the minute, and ss
is the seconds.
- If both arguments are specified:
- The first argument must be a date or a valid character string
representation of a date and the second argument must be a time or a valid
string representation of a time.
The result of the function is a timestamp. If either argument can be
null, the result can be null; if either argument is null, the result is
the null value.
The other rules depend on whether the second argument is specified:
- If both arguments are specified:
- The result is a timestamp with the date specified by the first argument
and the time specified by the second argument. The microsecond part of
the timestamp is zero.
- If only one argument is specified and it is a timestamp:
- The result is that timestamp.
- If only one argument is specified and it is a character string:
- The result is the timestamp represented by that character string.
If the argument is a character string of length 14, the timestamp has a
microsecond part of zero.
Example:
[ Top of Page | Previous Page | Next Page ]