Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Date, Time, and Timestamp Escape Sequences

Date, Time, and Timestamp Escape Sequences

 

ODBC defines escape sequences for date, time, and timestamp literals. The syntax of these escape sequences is as follows:


{d 'value'}
{t 'value'}
{ts 'value'}

In BNF notation, the syntax is as follows:

ODBC-date-time-escape ::=
     ODBC-date-escape
     | ODBC-time-escape
     | ODBC-timestamp-escapeODBC-date-escape ::=
     ODBC-esc-initiator d 'date-value' ODBC-esc-terminatorODBC-time-escape ::=
     ODBC-esc-initiator t 'time-value' ODBC-esc-terminatorODBC-timestamp-escape ::=
     ODBC-esc-initiator ts 'timestamp-value' ODBC-esc-terminatorODBC-esc-initiator ::= {
ODBC-esc-terminator ::= }
date-value ::= 
     years-value date-separator months-value date-separator days-valuetime-value ::= 
     hours-value time-separator minutes-value time-separatorseconds-valuetimestamp-value ::= date-value timestamp-separator time-valuedate-separator ::= -
time-separator ::= :
timestamp-separator ::=
     (The blank character)years-value ::= digit digit digit digitmonths-value ::= digit digitdays-value ::= digit digithours-value ::= digit digitminutes-value ::= digit digitseconds-value ::= digit digit[.digit...]

The date, time, and timestamp literal escape sequences are supported if the date, time, and timestamp data types are supported by the data source. An application should call SQLGetTypeInfo to determine whether these data types are supported.

Show:
© 2015 Microsoft