Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Trigger Help
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