Question : JZ0R2: No result set for this query

I'm calling a Sybase stored procedure from a Java program using the executeQuery() method. I'm using the stored proc to see whether a record exists given a key (passed into the proc). I process any rows returned.

It is possible for no records to match the key passed into the proc and I want to be able to capture this.

Problem is, when no rows are returned, executeQuery() throws an SQLException with the following error message - JZ0R2: No result set for this query

Is there a way for the stored proc to return no records without throwing the exception?

Thanks

Answer : JZ0R2: No result set for this query

>Is there a way for the stored proc to return no records without throwing the exception

The error is thrown by executeQuery because the store procedure returned a NULL.  You could add something to your procedure to make sure it returns something, even if it is just a empty string.
Random Solutions  
 
programming4us programming4us