Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> R: [beginner] Update with Cascade- how to ?
Hello,
I found an interesting article at oreview.com that describes exactly my
situation (it's at www.oreview.com/9704dbalb.htm).
As I'm not so expert on Oraclee I thought I could append the "cascade"
keyword to the UPDATE statement, so I could do safely update cascade like I
do
delete cascade.
The author of this article solves the problem by using a couple of triggers
and
procedures.
(Ps. once I've written a procedure, how do I execute it under SQLPlus ?
, with @procname ? )
Thanks again
Francesco
Frank <frankbo_at_interaccess.nl> wrote in message
8toqcl$90f$1_at_porthos.nl.uu.net...
> As usual: post the error code & message.
>
> The exception may be caused by a trigger, or by the foreign key
> constraint. In the latter case, you try to update a field in the
> child table to values that do not exist in the master table, or
> you update the master's unique key from a value, used by
> the childs records, to something else.
> By doing that, you break the foreign key relation (child records
> are left without a valid pointer to the master).
>
> Solution (if you really want this:)
> - disable foreign key constraint
> - change master
> - change children
> - enable fk constraint (won't work if not all is in order!)
>
> BTW: a table having a foreign key is the child (or detail) table
>
> --
> Frank
> Francesco Marchioni <Francesco.Marchioni_at_lastminutetour.com> schreef in
> berichtnieuws 8tmhnv$iet$1_at_marte.lastminutetour.com...
> > Hello,
> > I have the following problem:
> > I have a table that has child records
> > (Foreign keys) in another table.
> >
> > The table has been defined with Cascade delete
> > attributes so when I eliminate some
> > records also child records are deleted.
> >
> > Problem arise when I want to UPDATE the
> > value of some of these records. I get an Oracle
> > Exception that prevents me to do it, because
> > of child records.
> >
> > Did I have to set something else when I defined
> > the table, or I just must add something to my
> > Update clause ?
> >
> > thanks for your attention
> > Francesco
> >
> >
>
>
Received on Wed Nov 01 2000 - 05:50:52 CST
![]() |
![]() |