Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

Timestamp Literals

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

Syntax

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

| date-literal time-literal '

Arguments

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

A timestamp literal enclosed in an escape clause compatible with ODBC. Precede the literal string with an open brace ( { ) and a lowercase ts. End the literal with a close brace. For example:

INSERT INTO DTEST

VALUES ({ts '1956-05-07 10:41:37'})

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 literal.

time-literal

A time literal.

Example

SELECT * FROM DTEST WHERE C1 = {ts '1956-05-07 10:41:37'}

TOCIndex