Subject Re: [IBO] Problem in BindingCursor: Check Keylinks property Problem Ver 4.9.11
Author Colin
FOUND A SOLUTION !!

Function TFormPurchaseMain.DuplicateThisPurchase(zpur: Integer):integer;
var
sStr :String;
begin
Result := 0;
try
IBOQuerySQL.Close;
IBOQuerySQL.Sql.Clear;
sStr := 'execute block returns(i int) AS ' +
'declare variable New_zpur integer; ' +
'begin ' +
' new_zpur = gen_id(acpur_gen, 1); ' +
' insert into acpur(ZPUR,ZNOM,ZSUP,ZSTATUS,ZVATCODE,ZEMP,ZSUPDLV, ' +
' ZEMPAUTH,ZCHASE,ZEMPORD,ZORDERBY,ZPED,ZPEDTXT,ZDATEORD,ZCONTACT, ' +
' ZTERMS,ZDELINS,ZBOOKIN,ZCAR,ZSUBT,ZVATAMT,ZTOTAL,ZEXCHANGE,ZPAID, ' +
' ZDATEPAID,ZSUPCONT )' +
' select :new_zpur,xp.ZNOM,xp.ZSUP,xp.ZSTATUS,xp.ZVATCODE,xp.ZEMP,xp.ZSUPDLV, ' +
' xp.ZEMPAUTH,xp.ZCHASE,xp.ZEMPORD,xp.ZORDERBY,xp.ZPED,xp.ZPEDTXT,xp.ZDATEORD,xp.ZCONTACT, ' +
' xp.ZTERMS,xp.ZDELINS,xp.ZBOOKIN,xp.ZCAR,xp.ZSUBT,xp.ZVATAMT,xp.ZTOTAL,xp.ZEXCHANGE,xp.ZPAID, ' +
' xp.ZDATEPAID,xp.ZSUPCONT ' +
' from acpur xp ' +
' where xp.zpur = ' + IntToStr(zpur) +';' +
' insert into acpurit (ZPURIT,ZPUR,ZVATCODE,ZCTR,ZMATSPEC,ZQPAR,ZNOM,ZPRT,ZPICOFC,ZCERT,ZDATEREQ, ' +
' ZRITQTY,ZPARTNO,ZUNITS,ZRITDESC,ZPRICE,ZTOTAL,ZVATPCENT,ZPUOM,ZPDETAIL,ZASSY, ' +
' ZORD,ZFULLINV,ZPARTINV)' +
' select gen_ID(acpurit_gen,1),:new_zpur,xi.ZVATCODE,xi.ZCTR,xi.ZMATSPEC,xi.ZQPAR,xi.ZNOM,xi.ZPRT,xi.ZPICOFC,xi.ZCERT,xi.ZDATEREQ, ' +
' xi.ZRITQTY,xi.ZPARTNO,xi.ZUNITS,xi.ZRITDESC,xi.ZPRICE,xi.ZTOTAL,xi.ZVATPCENT,xi.ZPUOM,xi.ZPDETAIL,xi.ZASSY, ' +
' xi.ZORD,xi.ZFULLINV,xi.ZPARTINV ' +
' from acpurit xi ' +
' where xi.zpur = ' + IntToStr(zpur) +';' +
' i = 1 ; suspend ;' +
'end ';
IBOQuerySQL.sql.Add(sStr);
IBOQuerySQL.Prepare;
IBOQuerySQL.ExecSQL;

Result := 1;
Except
Result := 0;
end;
end;

Now it runs fine...thanks guys