Subject Re: [IBO] Callback question
Author Jason Wharton
You would modify the procedure so that it DOES return rows. In each place
there is a suspend in your procedure you will have a row returned to the
client. This gives you an opportunity to take information being returned
from the stored procedure and update a progress bar.

Try to use the FOR UPDATE clause on the SELECT to see if it will cause the
server to send each row as it is generated rather than bunching them up in
batches.

Jason

----- Original Message -----
From: "Salvatore Besso" <s.besso@...>
To: <IBObjects@yahoogroups.com>
Sent: Thursday, January 01, 2004 8:14 AM
Subject: Re: [IBO] Callback question


> hello Jason,
>
> first of all Happy New Year to all and thank you for your quick reply.
>
> > If your query is only for a single record returned
>
> No, as said in my previous message the procedure scans a table with a
> FOR SELECT..DO loop but doesn't return any record, it elaborates some
> values internally to update (at the end of the loop) other tables.
> More or less the skeleton is as follows:
>
> BEGIN
> FOR
> SELECT T1Field1, T1Field2 FROM Table1
> INTO Var1, Var2
> DO
> BEGIN
> UPDATE Table2
> SET T2Field1 = 0
> WHERE ID = :Var1;
> UPDATE Table3
> SET T3Field1 = 0
> WHERE ID = :Var1;
> Set some local variables = 0;
> FOR
> SELECT T4Field1, T4Field2, T4Field3, T4Field4 FROM Table4
> WHERE ID = :Var1
> INTO Var3, Var4, Var5, Var6
> DO
> BEGIN
> Elaborate values from Table4 in local variables;
> ...
> END
> Update Table5 with elaborated values from Table4;
> END
> END ^
>
> > I have deliberately put long running processes into
> > select procedures so that I could keep a progress
> > bar updated.
>
> Can you please explain further? I'm afraid to have not understood :-)
>
> Regards
> Salvatore