Sintax Error with trigger executing dbimport in Linux-IDS.9.30.UC3
Posted in 2004
Hi,
I've a problem when importing via-dbimport a database.
In the code showed below we can see two codes :
1.- Source code of trigger cefeconh_upd, where we are programing an
UPDATE
of column aptcon to NULL...
2.- Code unloaded by dbexport of the same trigger. Gere we can see
that
IDS has "loosed" the NULL word in the UPDATE statment and it produces
a
sintax error when processing de dbimport.
3.- The trigger is correctly working in the original database ( the
database
source of the dbexport...)
This happens in :
IDS : DB-Access Version 9.30.UC3
S.O.: Linux dbsrv2 2.4.19-16mdkenterprise #1
(... source code of trigger cefeconh_upd ... )
create trigger cefeconh_upd update OF proori, terori, prodes, terdes,
fecpro, feccon ON cefeconh
referencing new as nxt old as prvfor each row
WHEN (prv.feccon IS NULL AND nxt.feccon IS NULL AND
(prv.proori != nxt.proori OR
prv.terori != nxt.terori OR
prv.prodes != nxt.prodes OR
prv.terdes != nxt.terdes OR
prv.fecpro != nxt.fecpro))
(
UPDATE cefeconl SET aptcon = NULL
WHERE rowenl = nxt.apteid
AND aptcon IS NOT NULL,
DELETE FROM cefeconl
WHERE rowenl = nxt.apteid
AND numero IS NOT NULL
),
WHEN (prv.feccon IS NULL AND nxt.feccon IS NOT NULL)
(
EXECUTE PROCEDURE cefeconh_contab(nxt.apteid, nxt.feccon)
),
WHEN (prv.feccon IS NOT NULL AND nxt.feccon IS NULL)
(
EXECUTE PROCEDURE cefeconh_contab(nxt.apteid, nxt.feccon)
),WHEN (prv.feccon IS NOT NULL AND
nxt.feccon IS NOT NULL AND
prv.feccon != nxt.feccon)
(
EXECUTE PROCEDURE sdm_raise_msg(-746,
'cefeconh_upd: No se permite cambiar la fecha contable.')
);
(... fragment of code from a dbschema of table cefeconh for trigger
cefeconh_upd ... )
create trigger "informix".cefeconh_upd update of proori,terori,
prodes,terdes,fecpro,feccon on "informix".cefeconh referencing
old as prv new as nxt
for each row
when ((((prv.feccon IS NULL ) AND (nxt.feccon IS NULL
) ) AND (((((prv.proori != nxt.proori ) OR (prv.terori !=
nxt.terori
) ) OR (prv.prodes != nxt.prodes ) ) OR (prv.terdes != nxt.terdes
) ) OR (prv.fecpro != nxt.fecpro ) ) ) )
(
update "informix".cefeconl set "informix".cefeconl.aptcon
= where ((rowenl = nxt.apteid ) AND (aptcon IS NOT NULL ) ) ,
delete from "informix".cefeconl where ((rowenl =
nxt.apteid ) AND (numero IS NOT NULL ) ) ),
when (((prv.feccon IS NULL ) AND (nxt.feccon IS NOT
NULL ) ) )
(
execute procedure "informix".cefeconh_contab(nxt.apteid
,nxt.feccon )),
when (((prv.feccon IS NOT NULL ) AND (nxt.feccon IS
NULL ) ) )
(
execute procedure "informix".cefeconh_contab(nxt.apteid
,nxt.feccon )),
when ((((prv.feccon IS NOT NULL ) AND (nxt.feccon IS
NOT NULL ) ) AND (prv.feccon != nxt.feccon ) ) )
(
execute procedure "informix".sdm_raise_msg(-746 ,
'cefeconh_upd: No se permite cambiar la fecha contable.' ));
( ... )
Any idea ???
Thanks in advance !