IN-List Expansion (deprecated in 16.20)

ODBC Driver for Teradata® User Guide

brand
Teradata Tools and Utilities
prodname
ODBC Driver for Teradata
vrm_release
16.20
category
User Guide
featnum
B035-2526-108K

The parser transforms an IN-list containing ODBC Date, Time, Timestamp, or Interval literal escapes into a sequence of comparisons to work around a limitation in the database where only constants and not expressions are allowed in the in-list. This transformation is deprecated in 16.20.

For example, in Integer Date mode the ODBC Date literal {d '2008-11-28'} is expanded to:

('2008-11-28' (DATE, FORMAT 'YYYY-MM-DD'))

The resulting expansion is regarded as an expression by the database and is not allowed in the IN-list. The ODBC parser therefore transforms a construct like:

... x IN ({d '2008-11-28'}, {d '2009-12-29'})

into:

... (x = ('2008-11-28' (DATE, FORMAT 'YYYY-MM-DD'))

Or

x = ('2009-12-29' (DATE, FORMAT 'YYYY-MM-DD')))

With the new parser the ODBC date literal escape sequence is expanded as DATE 'YYYY-MM-DD'. For example in Integer Date mode the ODBC Date literal {d '2008-11-28'} is expanded to: DATE '2008-11-28'. New parser in-list expansion of Integer-Date works fine, but does will work in the case of Integer-Time, because the resulting Native-Syntax is an expression. The workaround is to switch to ANSI time.