Programmer Guide : Minimum SQL grammar requirements for ODBC : Literals in ODBC
  
Literals in ODBC
This section contains information that will help driver writers who are converting a character string type to a numeric or interval type, or from a numeric or interval type to a character string type.
Interval literal syntax
The following syntax is used for interval literals in ODBC.
interval_literal ::= INTERVAL [+|_] interval_string interval_qualifier
interval_string ::= quote { year_month_literal
    | day_time_literal } quote
year_month_literal ::= years_value | [years_value] months_value
day_time_literal ::= day_time_interval | time_interval
day_time_interval ::= days_value [hours_value
    [:minutes_value[:seconds_value]]]
time_interval ::= hours_value [:minutes_value [:seconds_value ] ]
    | minutes_value [:seconds_value ]
    | seconds_value
years_value ::= datetime_value
months_value ::= datetime_value
days_value ::= datetime_value
hours_value ::= datetime_value
minutes_value ::= datetime_value
seconds_value ::= seconds_integer_value [.[seconds_fraction] ]
seconds_integer_value ::= unsigned_integer
seconds_fraction ::= unsigned_integer
datetime_value ::= unsigned_integer
interval_qualifier ::= start_field TO end_field
    | single_datetime_field
start_field ::= non_second_datetime_field
    [(interval_leading_field_precision )]
end_field ::= non_second_datetime_field
    | SECOND[(interval_fractional_seconds_precision)]
single_datetime_field ::= non_second_datetime_field
    [(interval_leading_field_precision)]
    | SECOND[(interval_leading_field_precision
    [, (interval_fractional_seconds_precision)]
datetime_field ::= non_second_datetime_field | SECOND
non_second_datetime_field ::= YEAR | MONTH | DAY | HOUR | MINUTE
interval_fractional_seconds_precision ::= unsigned_integer
interval_leading_field_precision ::= unsigned_integer
quote ::= ’ unsigned_integer ::= digit...
Numeric Literal Syntax
The following syntax is used for numeric literals in ODBC:
numeric_literal ::= signed_numeric_literal | unsigned_numeric_literal
signed_numeric_literal ::= [sign] unsigned_numeric_literal
unsigned_numeric_literal ::= exact_numeric_literal
    | approximate_numeric_literal
exact_numeric_literal ::= unsigned_integer [period[unsigned_integer]]
    | period unsigned_integer
sign ::= plus_sign | minus_sign
approximate_numeric_literal ::= mantissa E exponent
mantissa ::= exact_numeric_literal
exponent ::= signed_integer
signed_integer ::= [sign] unsigned_integer
unsigned_integer ::= digit...
plus_sign ::= +
minus_sign ::= _
digit ::= 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0
period ::= .
See also
Minimum SQL grammar requirements for ODBC