Subject Need help with a simple OnCallBack for a progress meter
Author Chuck Belanger
Hello:

I'm just trying to get a progress bar for a lengthy query which uses a
UDF. I've searched the archives for the correct use of OnCallBack, but
for some reason, I just can't get it to work.

Could someone please help me out? It seems that OnCallBack is never
fired, although I understood from the archives that using a SELECT
PROCEDURE with SUSPEND would do that.

I admit that below is the first stored procedure I ever wrote, too.

I'm using IBO 4.2Ie, XP, D7 and FireBired Embedded, local/desktop
application. The table, MasterLibrary, has 41,000 records.

I've confirmed that the procedure actually works in IB_SQL.

Thank you,

Chuck Belanger


//ib_cursor settings:
CallBackInc := 1
CallBackInitInt := 1
CallBackRefresh := 1

//button's OnCLick event for testing
with ib_cursor do
begin

SQL.Clear;
Sql.Add('SELECT * FROM myProc(Param) ');
Execute;
end;


//OnCallBack event for IB_cursor:
fcProgressBar1.Progress := Trunc((CursorRowNum/TotalRows)*100);

//stored procedure from IB_Expert for myProc
begin
/* Procedure Text */
for select m.ml_id, myUDF(m.ml_item,:K) ,
myUDF(m.ml_upper_item,:K)
from MasterLibrary m
Order by 3
INTO
:MLID,
:MLITEM,
:MLUPITEM
do begin
suspend;
end
end