10. Understanding ODBC Connectivity : ODBC Programming : Date/Time Columns and Values : Default Treatment of Date/Time Syntax
 
Share this page                  
Default Treatment of Date/Time Syntax
If the ODBC driver is connected to a pre-Ingres 9.1 database, including gateways and EDBC, Ingres syntax is applied for date and time values.
If the ODBC driver is connected to an Ingres 9.1 or later database, ANSI syntax is applied for date and time values.
If both connection attributes DateAlias and SendDateTimeAsIngresDate are left unspecified, the default behavior of the driver may change. The following table shows how DateAlias and SendDateTimeAsIngresDate interact for undefined attributes:
DATEALIAS
SENDDATETIMEASINGRESDATE
Resulting Values
ansidate
undefined
ansidate, false
ingresdate
undefined
ingresdate, true
undefined
Y
ingresdate, true
undefined
N
ansidate, false
undefined
undefined
ingresdate, true
"False" Magic Dates
ODBC does not know whether a given column is an ANSI date/time type or an Ingresdate type. This ambiguity can cause problems.
For example, 9999-12-31 is a valid ANSI date. Therefore, if the ODBC driver and the Ingres database support ANSI syntax, applications that insert dates of 9999-12-31 into ingresdate fields will retrieve 9999-12-31, but the result is not an empty date. Instead, this is the actual date 9999-12-31. This is a "false" empty date.
Note:  If your application uses INGRESDATEs, the default ANSI syntax can cause corrupt data, or cause search queries to fail. Specify the Ingres ODBC configuration attribute "Send Date/Time as Ingres Date" or connection string attribute "SendDateTimeAsIngresDate=y" to force the ODBC Driver to use INGRESDATE syntax.