Subject Re: [Firebird-Architect] Re: RFC: Please unify stored procedure execution
Author Martijn Tonies
Hello Roman,

> > Care to show us that example?
> >
> > (as some seem to think that the existence of output parameters makes
> > it selectable ;-)
>
> Vlad posted example IF (1=0) THEN SUSPEND;. No real example was
> showed, but let me suggest following:
>
> CREATE PROCEDURE test(a INTEGER) RETURNS (b INTEGER)
> AS BEGIN
> b = 2;
>
> IF (0=1) THEN
> SUSPEND;
>
> b = 3;
> END
>
> If this condition never happens, then we have pretty legitimate
> executable procedure with SUSPEND inside and when it is called with
> SELECT * FROM it will return empty result set.

Well, yes. But that's possible with a "valid" stored procedure anyway.
IF it returns a resultset, this resultset may be empty. Nothing wrong with
that, right?

That is, unless you want "b" with the result "3" - but then you should
have put another SUSPEND in the code.

This sounds like a logical error to me.

> But again, this is far beyond my knowledge of BLR and must be answered
> by core engine developers.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server
Upscene Productions
http://www.upscene.com