The TIMESTAMP function returns a timestamp from its argument or arguments.
If both arguments are specified, the first argument must be an expression that returns a value of one of the following built-in data types: a date, a character string, or a graphic string. If expression-1 is a character or graphic string, it must not be a CLOB or DBCLOB and its value must be a valid string representation of a date.
If expression-2 is a character or graphic string, it must not be a CLOB or DBCLOB and its value must be a valid string representation of a time. For the valid formats of string representations of times, see String representations of datetime values.
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:
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.
The result is that timestamp.
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.
When a string representation of a date, time, or timestamp is SBCS data with a CCSID that is not the same as the default CCSID for SBCS data, that value is converted to adhere to the default CCSID for SBCS data before it is interpreted and converted to a timestamp value.
When a string representation of a date, time, or timestamp is mixed data with a CCSID that is not the same as the default CCSID for mixed data, that value is converted to adhere to the default CCSID for mixed data before it is interpreted and converted to a timestamp value.
Syntax alternatives: If only one argument is specified, the CAST specification should be used for maximal portability. For more information, see CAST specification.
SELECT TIMESTAMP( DATE('1988-12-25'), TIME('17.12.30') ) FROM SYSIBM.SYSDUMMY1Returns the value '1988-12-25-17.12.30.000000'.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.