Timestamp Literal

 

Syntax

 

timestamp_literal.bmp

 

YEAR:

 

four_digit_literal.bmp

 

MONTH:

 

two_digit_literal.bmp

 

DAY:

 

two_digit_literal.bmp

 

DATE SEPARATOR:

 

date_separator.bmp

 

 

HOUR:

 

two_digit_literal.bmp

 

MINUTE:

 

two_digit_literal.bmp

 

SECOND:

 

two_digit_literal.bmp

 

TIME SEPARATOR:

 

time_separator.bmp

 

A timestamp literal has the format:

 

{ts 'YYYY[- | / | .]MM[- | / | .]DD[ | - | . | /]HH[: | - | .]MM[: | - | .]SS[- | / | .FFFFFFFFF]' }

 

where :

  • YYYY is the four digit year

  • MM is the one or two digit month of the year (between 1 and 12)

  • DD is the one or two digit day of the month (between 1 and 31)

  • HH is the one or two digit hour in 24 hour format (0 to 23)

  • MM is the one or two digit minute (0-59), SS is the one or two digit seconds (0-59)

  • FFFFFFFFF is the zero to 10 digit fractional component of the seconds

  • Timestamp literals have a Timestamp SQL type.

  • When a character literal is used in an expression that expects a timestamp, CONNX will assume the supplied character string is a timestamp literal, even without the timestamp literal prefix '{ts' and suffix '}'.

Examples of valid timestamp literals:

 

Literal

Validity

{ts '2014-03-01 12:34:56' }

valid

{ts  '2014-03-01 12:34:56.12345678' }

valid

{ts '2014/03/01 12.34.56' }

valid

{ts '2014.03.01-12.34.56.12345678' }

valid

{ts  '2014.33.01-12.34.56.12345678' }   

invalid month