Datetime in ODBC
Posted in 1999
Topics: Connectivity: ODBC / JDBC / .NET
Hi, Got a quick question. Environment: Informix 7.30 UC5 WinNT workstation / Informix CLI 3.10 A program does an SQLBindParameter and inserts a datetime into a table containing a datetime year to second. Things work fine with the right datetime value ( year to second). However, when the datetime value is NULL ( or " " or 0) the program fails with an error. Datetime field overflow. Error in parameter 'n'. Any ideas on how to avoid this ? Any clues as to why this happens ? This happens in CLI 2.8/ 3.10. Thanks in advance Madan *==============================* Madan Mashalkar *==============================*
Hi Madan, You have to specify the last parameter or SQLBindParameter to SQL_NULL_DATA if the value is null or else the driver will try to convert and empty string to datatime. For more info check the help file for SQLBindParameter. Hope this helps, Imran. =========================================== Imran Hussain MCP, MCSD imranh@imranweb.com FOR FREE Software http://www.imranweb.com/freesoft =========================================== Madan Mashalkar wrote: > Hi, > > Got a quick question. > Environment: Informix 7.30 UC5 > WinNT workstation / Informix CLI 3.10 > > A program does an SQLBindParameter and inserts a datetime > into a table containing a datetime year to second. > > Things work fine with the right datetime value ( year to second). > However, when the datetime value is NULL ( or " " or 0) the program > fails with an error. > Datetime field overflow. Error in parameter 'n'. > > Any ideas on how to avoid this ? > Any clues as to why this happens ? > This happens in CLI 2.8/ 3.10. > > Thanks in advance > Madan > *==============================* > Madan Mashalkar > *==============================* --