Timestamp literals

Timestamp literals specify a date and a time separated by a space, enclosed in single quotation marks ( ' ' ).

Syntax

This is the syntax for timestamp literals:

{ ts 'yyyy-mm-dd hh:mi:ss' }

Parameters

{ ts 'yyyy-mm-dd hh:mi:ss' }

A timestamp literal enclosed in an escape clause is compatible with ODBC. Precede the literal string with an open brace ( { ) and a lowercase ts. End the literal with a close brace ( } ). Note that braces are part of the syntax. If you use the ODBC escape clause, you must specify the timestamp using the format yyyy-mm-dd hh:mi:ss.

date_literal

A date.

time_literal

A time literal.

Example

The following example illustrates how to INSERT a timestamp literal into a column:

INSERT INTO DTEST 
VALUES ( { ts '1956-05-07 10:41:37'} ) ;

The following example illustrates a timestamp literal with the ODBC escape clause:

SELECT * FROM DTEST WHERE C1 = {ts '1985-08-10 05:41:37'} ;