Subject | Re: [IBO] Returning value from SP |
---|---|
Author | Hans Hoogstraat |
Post date | 2004-03-29T03:36:48Z |
Maybe the error is in the documentation you have, and no changes to your
docs are required. :)
Just makes little sense to me, that
Create procedure SingleLine
Returns (a integer)
as
begin
a = 1;
Suspend;
end
would not require a 'suspend' to return the result, and
Create procedure SingleLine
Returns (a integer)
as
begin
for select val from table
into a:
do
suspend;
end
does require it to return possible multirow results, if both called via a
select.
what would the following procedure supposed to return, if called via a
select ?
Create procedure SingleLine
Returns (a integer)
as
begin
a = 1;
Suspend;
a = 2;
end
As far as IBO, it all depends how many times you require to call a
particular procedure. With all the differences between FB and IBO
versions on calling procedures via an excute, you so nicely posted
in one of your previous replies, it sounds less worrisome to just
use a select :)
Hope you saved a copy of your reply for your book, it was very
useful information.
Best regards
Hans
----------------------------------------------------------------------------
--
docs are required. :)
Just makes little sense to me, that
Create procedure SingleLine
Returns (a integer)
as
begin
a = 1;
Suspend;
end
would not require a 'suspend' to return the result, and
Create procedure SingleLine
Returns (a integer)
as
begin
for select val from table
into a:
do
suspend;
end
does require it to return possible multirow results, if both called via a
select.
what would the following procedure supposed to return, if called via a
select ?
Create procedure SingleLine
Returns (a integer)
as
begin
a = 1;
Suspend;
a = 2;
end
As far as IBO, it all depends how many times you require to call a
particular procedure. With all the differences between FB and IBO
versions on calling procedures via an excute, you so nicely posted
in one of your previous replies, it sounds less worrisome to just
use a select :)
Hope you saved a copy of your reply for your book, it was very
useful information.
Best regards
Hans
----------------------------------------------------------------------------
--
----- Original Message -----
From: "Helen Borrie" <helebor@...>
To: <IBObjects@yahoogroups.com>
Sent: Sunday, March 28, 2004 5:12 PM
Subject: Re: [IBO] Returning value from SP
> At 04:09 PM 28/03/2004 -0700, you wrote:
> >Via IBWISQL I created
> >
> >Create procedure SingleLine
> >Returns (a integer)
> >as
> >begin
> >a = 1;
> >end
> >
> >and executed 'select * from SingleLine' and received nothing.
> >
> >then changed it to
> >
> >Alter procedure SingleLine
> >Returns (a integer)
> >as
> >begin
> >a = 1;
> >Suspend;
> >end
> >
> >and received one row with the value 1.
> >
> >I obtained the same results using a TIBOQuery.
>
> Yes, I confirm that you are correct in this observation...so stick with
> suspend if you're going to use a SELECT to get this (for now: according
to
> the information I have, it's a bug (not an IBO one - it's reproducible
with
> isql) so I'll have change some things in the book to document it :-(*
>
> But, as an IBO user, *don't* use a SELECT procedure (TIBOQuery, TIB_Query)
> for this kind of operation - it's too costly. Make the procedure an
> executable one (no suspend!!) and use a TIB_DSQL or a TIB_Cursor for
> it. Call Execute and read Fields to get the result.
>
> cheers,
> Helen
>
>
>
>
___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
> without the need for BDE, ODBC or any other layer.
>
___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links
>
>
>
>