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

Home -> Community -> Usenet -> c.d.o.server -> Re: Trigger Help

Re: Trigger Help

From: James A. Johnson <nimbus3_at_bellsouth.net>
Date: 1998/12/28
Message-ID: <3686DAE9.47B63E64@bellsouth.net>#1/1

First off, you can not insert a new key because it is a primary key. '1' is the primary and the index will bark because there is already a primary key. I suggest updating the key with the appropriate data.

Jeff Hunter wrote:

> I want to write a trigger that will update non-primary key fields in a table
> on an insert. For example, I have a table called CUST that has two fields,
> ID and NAME. The ID field is the primary key. The CUST table might look
> like:
>
> ID NAME
> 1 Scooby Doo
> 2 Scrappy Doo
> 3 Shaggy
>
> When I issue "insert into CUST values (1,'Freddy'); I want the table to look
> like:
>
> ID NAME
> 1 Freddy
> 2 Scrappy Doo
> 3 Shaggy
>
> Any suggestions?
Received on Mon Dec 28 1998 - 00:00:00 CST

Original text of this message

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