Oracle Database 
Author Message
 Oracle Database

Help....

I am using an Oracle database with version 2.573 of the ODBC driver and on
the open() statement I do:

Open(AFX_DB_USE_DEFAULT_TYPE,"SELECT SUBID,COUNT(*) AS TOTAL FROM TABLE1
GROUP BY SUBID);

and I get an error "Cannot use Keyset-driven cursor on join, with distinct
clause, union, intersect or minus or on read only result set".

The result set is dynaset so it is not read only.

So my question is how do I use COUNT(*) in a select statement for the ODBC
dirver with Oracle.

Thanks,

Bryan Garrett



Sat, 26 Jul 2003 02:23:23 GMT  
 Oracle Database


Quote:
> Help....

> I am using an Oracle database with version 2.573 of the ODBC driver
and on
> the open() statement I do:

> Open(AFX_DB_USE_DEFAULT_TYPE,"SELECT SUBID,COUNT(*) AS TOTAL FROM
TABLE1
> GROUP BY SUBID);

> and I get an error "Cannot use Keyset-driven cursor on join, with
distinct
> clause, union, intersect or minus or on read only result set".

> The result set is dynaset so it is not read only.

> So my question is how do I use COUNT(*) in a select statement for the
ODBC
> dirver with Oracle.

In the Oracle8 ODBC driver, you'll get a warning to this effect and
your cursor will automatically be changed to a static cursor.  If you
ask explicitly for a static cursor to begin with, you should be fine in
the 2.5 driver.

Essentially, the problem here is that Oracle's ODBC drivers implement
keyset-driven cursors by relying on ROWID's.  If the rows of your
resultset cannot be correlated with ROWID's (i.e. because they're the
result of an aggregating function like count()), the drivers can't give
you a keyset cursor.

Justin Cave

Sent via Deja.com
http://www.deja.com/



Sat, 26 Jul 2003 04:13:41 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. can't get data from oracle database

2. SQL Server and Oracle database export/import

3. Getting available SQL Servers/Oracle Databases

4. Oracle Database

5. Unix programming for Oracle Database

6. Queriying an Oracle database

7. Connecting to a Oracle Database

8. Connecting to an Oracle Database

9. VC++ and Oracle Databases

10. Accessing data in two DIFFERENT Oracle databases via ODBC

11. Does someone has connected to an Oracle database?

12. ODBC and Oracle Database

 

 
Powered by phpBB® Forum Software