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
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