CREATE TRIGGER insertar_historico_fcloc001 BEFORE DELETE ON fcloc001
FOR EACH ROW BEGIN
INSERT INTO `historico_fcloc001` (
`LOFE` ,
`LPED` ,
`LLINEA` ,
`LFECOFE` ,
`LFECPED` ,
`LITEM` ,
`LCODAR` ,
`LCODCL` ,
`LCANTI` ,
`LPRECI` ,
`LDTO` ,
`LIMPOR` ,
`LPLAZO` ,
`LCANSER` ,
`LCANPEN` ,
`LLIQUID` ,
`LCOSTE` ,
`LAMPDES` ,
`ACTUALIZAD` ,
`FECACTU` ,
`LALMACEN` ,
`LRESNUM1` ,
`LRESNUM2` ,
`LRESSN1` ,
`LRESSN2` ,
`LRESSN3` ,
`LRESSN4` ,
`LRESFEC1` ,
`LRESCAR1` ,
`LBULTOS` ,
`LNUMSERIES` ,
`LSECORD` ,
`LTXTORD` ,
`LCOSADI` ,
`LOBSINT` ,
`LPPR` ,
`LPREORIG` ,
`LLARGO` ,
`LANCHO` ,
`LALTO` ,
`LDTO2` ,
`LDTO3` ,
`LULTMODIF` ,
`LTIPIVA` ,
`LPORCIVA` ,
`LPORCREC` ,
`LIMPCONIVA`
)
VALUES (
OLD.LOFE,
OLD.LPED,
OLD.LLINEA,
OLD.LFECOFE,
OLD.LFECPED,
OLD.LITEM,
OLD.LCODAR,
OLD.LCODCL,
OLD.LCANTI,
OLD.LPRECI,
OLD.LDTO,
OLD.LIMPOR,
OLD.LPLAZO,
OLD.LCANSER,
OLD.LCANPEN,
OLD.LLIQUID,
OLD.LCOSTE,
OLD.LAMPDES,
OLD.ACTUALIZAD,
OLD.FECACTU,
OLD.LALMACEN,
OLD.LRESNUM1,
OLD.LRESNUM2,
OLD.LRESSN1,
OLD.LRESSN2,
OLD.LRESSN3,
OLD.LRESSN4,
OLD.LRESFEC1,
OLD.LRESCAR1,
OLD.LBULTOS,
OLD.LNUMSERIES,
OLD.LSECORD,
OLD.LTXTORD,
OLD.LCOSADI,
OLD.LOBSINT,
OLD.LPPR,
OLD.LPREORIG,
OLD.L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