Subject | RE: [Firebird-Java] Query returning row when it shouldn't... |
---|---|
Author | Steffen Heil |
Post date | 2004-05-31T14:32:19Z |
Hi
row).
Wrong. As a lot of others already stated, there is always a result to
agregate functions. NULL if necessary.
If you consider this a bug, what would you expect from the same query if
there were rows, but every row had an NULL in PK_SN? [I see, you ment PK_SN
to be an primary key (and therefor NOT NULL), but just imagine.]
Regards,
Steffen
> java.sql.Statement s = myConnection.createStatement();is that rs.next() should return false (indicating that there is not a 'next'
> ResultSet rs = s.executeQuery("select max(PK_SN) from MYTABLE");
> if (rs.next())
> // Then the row exists - return the value:
> return rs.getInt("PK_SN");
> This in itself is not a suprise because there are no rows... the problem
row).
Wrong. As a lot of others already stated, there is always a result to
agregate functions. NULL if necessary.
If you consider this a bug, what would you expect from the same query if
there were rows, but every row had an NULL in PK_SN? [I see, you ment PK_SN
to be an primary key (and therefor NOT NULL), but just imagine.]
Regards,
Steffen