Subject Re: Query returning row when it shouldn't...
Author Roman Rokytskyy
> That is encouraging but that link is not an official specification?

That's C. J. Date and Hugh Darwen A Guide to the SQL Standard. Fourth
edition, Addison-Wesley, Reading, Massachusetts, 1997. (ISBN
0-201-96426-0). SQL standard does not mention explicitly this issue
(at least I was not able to find it in SQL 99 standard).

> Anyway I do agree that the SQL should return null, but when done
> within Java/JDBC, is this the correct way for the user to get this
> result?

NULL is a value (ok, it is not a value, but rather a state, but in our
case it is a "value"), and result set is not empty, it contains
something (exactly that NULL). Since SELECT returns result set and
result set can only contain relations and values in relations are
represented by tuples (or rows, if you like), value is mapped into a
tuple (row). There is no other way to return a value from a SELECT
statement.

> I wonder if there is a JDBC spec which declares the
> behaviour.....

As far as I know - no.

Roman