Subject | Re: [ib-support] SELECT in stored proc returns wrong value |
---|---|
Author | Helen Borrie |
Post date | 2001-06-18T06:21:59Z |
At 08:33 PM 17-06-01 +0200, Lukas Zeller wrote:
You should always initialize variables and, if there is a chance that your variables in a loop are going to remain unchanged, because of an empty result set being returned, you should re-initialize them each time, just to avoid the problem that Christian brought upon himself.
If anyone thinks IB does ever return an empty set as a row of nulls, then he is mistaken. If IBConsole or some other tool does this, then it's the tool that is inconsistent, not IB.
Sorry to be blunt, but to me this stored proc was just an example of sloppy programming.
Regards,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________
>I'd guess, Interbase. I had the very same behaviour half a yearA bad guess, I think. An empty result set is an empty result set. It doesn't contain nulls because it doesn't contain anything.
>ago, unfortunately in a very complex stored procedure so it took
>me a day to find out what was wrong. The only solution was
>to set the Variable to NULL before the select.
You should always initialize variables and, if there is a chance that your variables in a loop are going to remain unchanged, because of an empty result set being returned, you should re-initialize them each time, just to avoid the problem that Christian brought upon himself.
If anyone thinks IB does ever return an empty set as a row of nulls, then he is mistaken. If IBConsole or some other tool does this, then it's the tool that is inconsistent, not IB.
Sorry to be blunt, but to me this stored proc was just an example of sloppy programming.
Regards,
Helen
All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________