PRB: SELECT DISTINCT Fails with Microsoft ODBC for Oracle (277667)
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
- Microsoft ODBC for Oracle version 2.5 Build 2.573.4202
- Microsoft ODBC for Oracle version 2.5 Build 2.573.4403
- Microsoft ODBC for Oracle version 2.5 Build 2.573.5303
- Microsoft ODBC for Oracle version 2.5 Build 2.573.6019
- Microsoft ODBC for Oracle version 2.5 Build 2.573.6526
- Microsoft ODBC for Oracle version 2.5 Build 2.573.7326
- Microsoft ODBC for Oracle version 2.5 Build 2.573.7626
- Microsoft ODBC for Oracle version 2.5 Build 2.573.7713.2
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.7
This article was previously published under Q277667 SYMPTOMS
When a SELECT DISTINCT statement is used with the Microsoft ODBC for Oracle driver, the following error may occur:
DIAG [HYC00] [Microsoft][ODBC driver for Oracle]Cannot use Keyset-driven cursor on join, with distinct clause, union, intersect or minus or on read only result set (0)
CAUSE
The Microsoft ODBC for Oracle driver uses the hidden Oracle column ROWID, which assigns a unique ID for each row. Because this negates the uniqueness constraint imposed by the DISTINCT keyword, the driver issues the above error rather than bring back multiple copies of the same data.
RESOLUTION
If you require the use of the DISTINCT keyword, you can use the Microsoft OLE DB Provider for Oracle, because the provider doesn't use the ROWID column when DISTINCT is used.
For additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
258997 INFO: Oracle OLE DB Provider and ROWID Use
There is no workaround for this behavior with the Microsoft ODBC for Oracle driver.
Modification Type: | Major | Last Reviewed: | 12/5/2003 |
---|
Keywords: | kbOracle kbprb KB277667 |
---|
|