Subject Re: [IBO] TIB_StoredProc
Author Lucas Franzen
guido.klapperich@... schrieb:
>
> I have a stored procedure, that looks like
> CREATE PROCEDURE P_APPROVE_DISCOUNTS (
> DCID INTEGER)
> AS
> declare variable FDID Integer;
> begin
> /* Übernimmt die beantragten Discount-Werte */

Note: REMOVE THE *Ü*, otherwise some tools will have problem to show the
procedure! (code willk snipped off at that place when showing)


> update DISCOUNTS set DCDISCOUNT=DCDISCOUNTNEW, DCDISCOUNTNEW=0 where
> DCID=:DCID;
> update DISCOUNTS_MP set DMDISCOUNT=DMDISCOUNTNEW, DMSUM=DMSUMNEW,
> DMDISCOUNTNEW=0, DMSUMNEW=0 where
> DMDCID=:DCID;
> select FDID from FOLLOWUPDISCOUNTS where FDDCID=:DCID into :FDID;
> update FOLLOWUPDISCOUNTS_MP set FMDISCOUNT=FMDISCOUNTNEW,
> FMDISCOUNTNEW=0
> where FMFDID=:FDID;
> end

FOR select FDID from FOLLOWUPDISCOUNTS
where FDDCID=:DCID into :FDID
DO BEGIN
update FOLLOWUPDISCOUNTS_MP
set
FMDISCOUNT=FMDISCOUNTNEW,
FMDISCOUNTNEW=0
where FMFDID=:FDID;
END;

this should work..


Regards
Luc.