Subject | Re: Help on TIB_StoredProc |
---|---|
Author | cyclon779 |
Post date | 2005-10-18T09:25:41Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@t...> wrote:
support. Have a nice day.
Seven
>runtime):
> At 05:38 PM 17/10/2005 +0000, you wrote:
> >Please help.
> >I have a SP on my database and it looks this way:
> >as input parameters (date1(DATE), date2(DATE),person_id(INTEGER))
> >as output parameters it must return
> >RETURNS (
> > ID INTEGER,
> > DATAX DATE,
> > NR_ACT VARCHAR(16),
> > SOLD_FSAI NUMERIC(15,4),
> > INCASARE NUMERIC(15,4),
> > PLATA NUMERIC(15,4),
> > SOLD_FSA NUMERIC(15,2))
> >
> >ok, the number of rows returned by the procedure could be between 3
> >and a few hundreds. I need to load the output into a grid and after
> >print it.
> >I use a TIB_CURSOR to execute the procedure, like this (from
> >======the
> >cursor.SQL.Clear;
> >cursor.SQL.Add(select * from calc_sold_fsa(param1,param2,param3));
> >------
> >
> >the problem is that in my grid only the first row is loaded. It's
> >first time when I use SP this way and if someone have time for me,output
> >please gimme some ideeas.
>
> OK, as Christian said, you will need to use IB_Query if you want the
> set to be in the scrollable IB_Grid. You *can* output an ib_cursorto an
> IB_CursorGrid, though this is nothing much more than a visiblecontainer in
> which to buffer the results.calling
>
> IB_Cursor by design returns rows one at a time. You "open" it by
> First and you access subsequent rows by calling Next while not EOF.a
>
> There may be a problem in your SP. It needs to have been written as
> selectable SP, viz.wait
>
> begin
> ...
> for select
> ID, DATAX. NR_ACT, SOLD_FSAI, INCASARE,
> PLATA, SOLD_FSA
> from aTable
> where DATAX between :date1 and :date2
> and ID = :person_id
> into :ID, :DATAX. :NR_ACT, :SOLD_FSAI, :INCASARE,
> :PLATA, :SOLD_FSA
> DO BEGIN
> /* massage the data if you need to */
> SUSPEND;
> END
> END
>
> This will put the first output row into a buffer at the server and
> until the application, i.e. your ib_cursor, calls First (to fetchthe first
> row). Then it will output the next row and wait for your ib_cursorto call
> Next.The SP was ok, it works fine with Ib_Query. Thank you all for your
>
> Helen
>
>
> Helen
>
support. Have a nice day.
Seven