MySQL Forums
Forum List  »  Stored Procedures

Re: How to return null/empty resultset from SP??
Posted by: Ming Yeung
Date: December 13, 2005 06:29AM

I have a question.

Let say [ret_id] is null, and the SP returns [ret_id] with a null.
e.g.)
...
SET ret_id = NULL;
SELECT ret_id;
...

Is the resultset empty? or it contains the [ret_id] which is null?
If the resultset returns the parameter of [ret_id] which has a NULL value...then I understand why the following statement is always true...because the resultset is not empty....

if (rs.next()) { ... this is always true
...rs.getInt("ret_id"); <--- always convert to ZERO by default if it is NULL.
}

If the above is correct, then how do I actually an empty resultset?

Thanks pem!



Edited 1 time(s). Last edit at 12/13/2005 06:34AM by Ming Yeung.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: How to return null/empty resultset from SP??
3193
December 13, 2005 06:29AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.