Tariq,
>PreparedStatement psmtCount = mConn.prepareStatement( "SELECT COUNT(ID) FROM "
>+ table + " WHERE TYPE = ?" );
>psmtCount.setString(1,typeName);
>ResultSet rstCount = psmtCount.executeQuery();
>int rows = 0;
>if( rstCount.next() ) {
> rows = rstCount.getInt(1);
>}
>
>actually this ResultSet is null as the query returns nothing but using
>InstantDB as database control is still going in if block, while with other
>databases it is not.......
The COUNT function with no GROUP BY clause is always supposed to return one row.
Mainstream products like Oracle and DB2 do just that. I think your other database is the one
not functioning correctly.
Regards,
Peter Yuill
-----------------------------------------------------------------------------
To unsubscribe from this mailing list, send email to majordomo@enhydra.org
with the text "unsubscribe instantdb" in the body of the email.
If you have other questions regarding this mailing list, send email to
the list admin at owner-instantdb@enhydra.org.
|