MS data provider for Oracle - SELECT COUNT(*)

J

Joubert Nel

Hi all,

I have encountered a strange situation.

I am trying to get the number of records in a given table (including
duplicates, etc.).

Normally, I would use SELECT COUNT(*) FROM MyBigAssTable
This works fine under SQL Server, Access, and Oracle (when using
System.Data.OleDb).

However, as soon as I use the Microsoft data provider for Oracle, the above
statement always returns 1 when there are zero records.

The way to get around this is to rather execute SELECT COUNT(*) "ID" FROM
MyBigAssTable. Of course this adds the restriction that only records that
are not-null for ID will be counted (since this is the PK, I'm not concerned
about that).

I've confirmed that in Oracle, using isqlplus, both the expected, and also
the workaround queries give the right results. So it would appear as if it
is the Microsoft data provider for Oracle that is at fault here.

I am using the Oracle 10g client, and 10g as the DBMS.

Does anybody have any insight into this?

Thanks
Joubert
 
N

ng

I had the misfortune to work on a .Net project with Oracle, when all
that was available was Microsoft DB drivers. Oracle now has their own
drivers that work with .Net, and are far superior. I can't help
wondering if Microsoft did it on purpose so developers would shy away
from Oracle! Oracle's web site has the DB driver for download on their
site.

T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top