Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: R: [beginner] Update with Cascade- how to ?

Re: R: [beginner] Update with Cascade- how to ?

From: Frank van Bortel <fbortel_at_home.nl>
Date: Sat, 04 Nov 2000 15:18:05 GMT
Message-ID: <3A0406C2.EAB92DFE@home.nl>

exec [procedure]

Francesco Marchioni wrote:

> 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
> > >
> > >
> >
> >

--
Gtrz,

Frank van Bortel
Received on Sat Nov 04 2000 - 09:18:05 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US