Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Easy Question ( I hope)
PRAGMA AUTONOMOUS_TRANSACTION allow commit in triggers.
Marek Jó+wik <mjozwik_at_wonlok.com.pl> wrote in message
news:8ug4lv$c0s$1_at_kujawiak.man.lodz.pl...
> > I know that you can't commit in triggers, so If I want to create a
> > parent key row before creating a child row, what is the best way to do
> > that? Should I have the before insert trigger run a stored procedure?
>
> Assume that table A is parent of table B.
>
> You can set foreign key on
> table B as DEFERRABLE INITIALLY DEFERRED.
>
> So, first you can insert row into table B and then into table A.
>
>
Received on Thu Nov 09 2000 - 15:00:06 CST