FIX: Incorrect Errors Occur with SELECT Queries Using Oracle 8.0.5 Tables That Have Date Fields (243810)
The information in this article applies to:
- Microsoft ODBC for Oracle version 2.5 Build 2.573.2927
- Microsoft ODBC for Oracle version 2.5 Build 2.573.3513
- Microsoft ODBC for Oracle version 2.5 Build 2.573.3711
This article was previously published under Q243810 SYMPTOMS
If a table that contains a date field is queried on an Oracle server, version 8.0.5.0, from a parameterized SELECT statement, an invalid error occurs.
For example, this code would cause the error:
SELECT * FROM table WHERE DATECOL = ?
The Oracle driver reports the following error message from Oracle when trying to derive column information:
[Microsoft][ODBC driver for Oracle][Oracle]ORA-01003:no statement parsed
CAUSE
The Microsoft ODBC for Oracle driver (Msorcl32.dll) binds the parameter only after deriving column information from Oracle, and in the case of date fields it gets an error message from Oracle, which it incorrectly reports back.
RESOLUTION
One way of getting around the problem is to tell Oracle that the parameter will be a date parameter, which resolves the problem.
Instead of this code:
SELECT * FROM temp1 WHERE c1 <= (?+1)
Use this code:
SELECT * FROM temp1 WHERE c1 <= (to_date(to_char(?))+1)
With this implementation, the column information is derived correctly.
An updated version of the Microsoft ODBC for Oracle, the msorcl32.dll file version 2.573.4202.3, which corrects this problem, is installed in the Microsoft Data Access Components (MDAC SP2 GA) update 2.1.2.4202.3.
STATUS
Microsoft has confirmed that this is a problem with the Microsoft ODBC for Oracle driver (msorcl32.dll) versions 2.573.2927, 2.573.3513 and 2.573.3711, which report the error message from Oracle incorrectly.
Modification Type: | Major | Last Reviewed: | 9/30/2003 |
---|
Keywords: | kbBug kbDriver kbfix kbMDAC260fix kbMDACNoSweep kbOracle KB243810 |
---|
|