From: esmith2112 on
If I have a stored procedure for which I have declared two cursors
"with return," but through the code enforce that only one of them is
opened depending on some logic test, what value should I use for the
RESULT SETS clause in the stored procedure declaration?

Thanks,
Evan
From: jefftyzzer on
On Jun 2, 6:23 am, esmith2112 <esmith2...(a)gmail.com> wrote:
> If I have a stored procedure for which I have declared two cursors
> "with return," but through the code enforce that only one of them is
> opened depending on some logic test, what value should I use for the
> RESULT SETS clause in the stored procedure declaration?
>
> Thanks,
> Evan

1

--Jeff
From: esmith2112 on

> 1
>
> --Jeff

That's what I would expect as well. However, we get the SQL0466W
warning on occasion for some procs telling us:

SQL0466W The procedure "<procedure-name>" returns "<number-results>"
result sets from the stored procedure.

The value we're getting for <number-results> is 1. The RESULT SETS
declaration in the procedure definition is also 1. Just scratching our
heads why we get this sqlcode back from the server.