Subject | Re: [ib-support] Wrong codeflow in SP. Possible bug |
---|---|
Author | Paul Reeves |
Post date | 2002-10-22T10:30:23Z |
Andrew Guts wrote:
if (Qty > 0) then
if (exists (select docid from Closed_Docs where DocID = :d)) then
exception xcptdoc_closed;
else
if (exists (select DocRow from Reserves where DocRow = :DocRow
and Term >= 'NOW' and AuthorID <> :E)) then
exception XCPT_RESERVED;
Try again with the judicious use of BEGIN and END.
Paul
--
Paul Reeves
http://www.ibphoenix.com
Supporting users of Firebird and InterBase
> Hello IB support.The compiler just doesn't respect your indentation, does it?
>
> This is a fragment of my stored proc. Qty is an integer parameter. The
> statement after "ELSE" is never executed. When I've replaced
> "ELSE" by "if (Qty <= 0) then" it works as expected. What is wrong with it?
>What the compiler sees is this:
> if (Qty > 0) then
> if (exists (select docid from Closed_Docs where DocID = :d))
> then exception xcptdoc_closed;
> else
> if (exists (select DocRow from Reserves where DocRow = :DocRow
> and Term >= 'NOW' and AuthorID <> :E))
> then exception XCPT_RESERVED;
>
if (Qty > 0) then
if (exists (select docid from Closed_Docs where DocID = :d)) then
exception xcptdoc_closed;
else
if (exists (select DocRow from Reserves where DocRow = :DocRow
and Term >= 'NOW' and AuthorID <> :E)) then
exception XCPT_RESERVED;
Try again with the judicious use of BEGIN and END.
Paul
--
Paul Reeves
http://www.ibphoenix.com
Supporting users of Firebird and InterBase