Subject | Re: [firebird-support] Procedure as Function calling |
---|---|
Author | Woody (TMW) |
Post date | 2005-05-04T20:28:13Z |
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
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)
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:be
> > >
> > > 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
> > more than one row returned.However, to solve his problem, you can remove the suspend statement and use
>
> Don't make it confusing -- if the procedure is called via a SELECT, use
> SUSPEND.
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)