Subject Re: [firebird-support] Procedure as Function calling
Author Woody (TMW)
From: "Martijn Tonies" <m.tonies@...>
To: <firebird-support@yahoogroups.com>
Sent: Wednesday, May 04, 2005 10:45 AM
Subject: Re: [firebird-support] Procedure as Function calling


> > > I have question. I have procedure, for example:
> > >
> > > CREATE PROCEDURE SQR(X INTEGER) RETURNS(RESULT INTEGER) AS
> > > begin
> > > Result=:x*:x;
> > > suspend;
> > > end
> >
> >
> > Remove the suspend statement. You don't need it since there will never
be
> > more than one row returned.
>
> Don't make it confusing -- if the procedure is called via a SELECT, use
> SUSPEND.

However, to solve his problem, you can remove the suspend statement and use
Execute procedure instead of select:

execute procedure Sqr(select Val from T where ID = 1)

That eliminates the need for the double select statement.

If that's not what he needs, then I apologize. I thought he was looking for
alternatives.

Woody (TMW)