Hello, I get the above message as a pop-up when I try & do
the following in an update trigger. Basically, before
inserting a detail line record, I check for the existence
of it's 2 parent header records, & if they don't exist,
create them in the appropriate tables. I think I have
re-worked the code to do as few sql statements as possible.
select <needed values> from detail,inserted, parent1_equiv, parent2_equiv
-- NOTE these tables are NOT actually parent1 & parent2
if (<trigger condition>)
if not exists(select * from parent1 where ...)
insert into parent1 (<columns>) values(<values>)
if not exists(select * from parent2 where ...)
insert into parent2 (<columns>) values(<values>)
insert into detail(<columns>) (<values>)
...
I don't see why this should cause a problem to any self-
respecting database server (and/or ODBC implementation).Can
anyone suggest a workaround or another way of doing this?
Surely this would be a common thing to do in applications,
(ie ensure referential integrity)?
T.I.A,
GAM
the following in an update trigger. Basically, before
inserting a detail line record, I check for the existence
of it's 2 parent header records, & if they don't exist,
create them in the appropriate tables. I think I have
re-worked the code to do as few sql statements as possible.
select <needed values> from detail,inserted, parent1_equiv, parent2_equiv
-- NOTE these tables are NOT actually parent1 & parent2
if (<trigger condition>)
if not exists(select * from parent1 where ...)
insert into parent1 (<columns>) values(<values>)
if not exists(select * from parent2 where ...)
insert into parent2 (<columns>) values(<values>)
insert into detail(<columns>) (<values>)
...
I don't see why this should cause a problem to any self-
respecting database server (and/or ODBC implementation).Can
anyone suggest a workaround or another way of doing this?
Surely this would be a common thing to do in applications,
(ie ensure referential integrity)?
T.I.A,
GAM