SET TERM ^ ;

create or alter procedure SPU_TRIBUTACAO_IPI
as
declare variable OPERACAO_VINCULO_CFOP_ID integer;
BEGIN
    FOR SELECT
        C.ID
    FROM TBOPERACAO T, TBOPERACAO_VINCULO_CFOP C
    WHERE T.ORIGEM = 2
    AND T.CODIGO = C.OPERACAO_CODIGO
    INTO :OPERACAO_VINCULO_CFOP_ID
    DO BEGIN
       UPDATE TBOPERACAO_VINCULO_CFOP C SET C.TRIBUTACAO_IPI = '53' WHERE C.ID = :OPERACAO_VINCULO_CFOP_ID;
    END
END
^

SET TERM ; ^

