Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: temp. undo delete in trigger / cascade delete via trigger..
have you tried defining the foreign key constraint as "deferrable" or "deferrable initially immediate" ? (not available prior to Oracle 8.0 )
your application can set the transaction deferrable, and the constraint will not be checked until the commit. this may get you around the problem.
"Jan-Erik Rosinowski" <spamfilter_at_rosinowski.de> wrote in
message news:393133f5.4942296_at_News.CIS.DFN.DE...
> hi,
>
> i would like to implement a cascade delete functionality in
our
> database which should be controllable e.g. normally it should
be
> disabled. so a solution ala 'on delete cascade' is not really
what we
> want.
>
> the referential integrity is enforced declaratively via
'references
> ...'
>
> using the emp/dep-example:
>
> in a before delete row-trigger i cannot delete the depending
records
> with 'delete emp where deptno=:old.deptno' because of
ora-4094,
> collecting the :old.deptnos in a pl/sql table as the
> update-cascade-package does it, doesn't help either as the
delete
> fails because of the child-records in emp. insert into dep
(deptno)
> values(:old.deptno) of course gives an ora-4091. how can i
get out of
> this circle?
>
>
> ciao, jan
>
> http://www.rsp.de/
>
> rs&p-Dossier: Software zur Erstellung technischer
Dokumentationen
> und Schriftgutes in Verwaltung und Industrie.
>
Received on Fri May 26 2000 - 00:00:00 CDT