Subject | Re: Stored Procedures using IBPP |
---|---|
Author | sperlis |
Post date | 2008-01-15T10:18:03Z |
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@...> wrote:
of a SELECT statement. The output in the xsqlda of an EXECUTE
PROCEDURE call is not buffered. It returns directly to the caller
(your IBPP program) as xsqlvar members in the xsqlda structure. So
ask on the IBPP list how to access the xsqlvar values in the xsqlda
that is returned by dsql_execute2 and you will be in business...
Thanks,
The penny dropped. Now I got it.
Again, thanks a lot,
sp
>by one from the output buffer that the server creates for the output
> At 07:48 PM 15/01/2008, you wrote:
> >--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@> wrote:
> >>
> >> At 05:01 AM 15/01/2008, Hans wrote:
> >> >For a select add a suspend; line
> >> >
> >> >CREATE PROCEDURE TestProc
> >> > RETURNS (five_val INTEGER)
> >> >AS BEGIN
> >> > five_val = 5;
> >> >suspend;
> >> >END;
> >>
> >> That's one way, but making the stored proc selectable is overkill
> >for a SP that returns one and only one result record. Selectable SPs
> >are designed for multiple-record output - "datasets" and require a lot
> >more overhead.
> >>
> >> Fb returns the output from an executed SP in the output xsqlda. The
> >better solution will be to find out how IBPP wraps the output xsqlvars
> >for executed SPs and read the result directly after execution.
> >>
> >> ./heLen
> >>
> >
> >Well, one way or not, it seems to not work! Obviously this isn't a
> >representative SP. Just something to start with before I get too deep.
> >IBPP seems to be providing an xsqlda as a destination for the reply
> >(using dsql_execute2). However, when I try using fetch (dsql_fetch) an
> >exception is thrown.
> >
> >Any other ideas?
>
> First, get sorted out what dsql_fetch does: it fetches records one
of a SELECT statement. The output in the xsqlda of an EXECUTE
PROCEDURE call is not buffered. It returns directly to the caller
(your IBPP program) as xsqlvar members in the xsqlda structure. So
ask on the IBPP list how to access the xsqlvar values in the xsqlda
that is returned by dsql_execute2 and you will be in business...
>OK!
> ./heLen
>
Thanks,
The penny dropped. Now I got it.
Again, thanks a lot,
sp