Re: :old in triggers

From: Michael Ryan <ryan_at_xsoft.xerox.com>
Date: 1995/09/06
Message-ID: <1995Sep6.213001.11635_at_xsoft.uucp>#1/1


In article <424pn0$22o5_at_trout.ab.umd.edu>, system_at_phaxp2.ab.umd.edu () writes:
>
>Help!
>Hi. I am trying to determine how to create
>an ORACLE trigger such that whenever a record
>is inserted, all the values for a primary key field
>get incremented by one

 [snip]
>This fails because :old fields cannot get reassigned.
>Perhaps there is a way to do this with an embedded SQL UPDATE.
>Thank you.

your example not only will not work but does not make any sense to me.

from the Oracle7 Server Application Developer's Guide, p. 8-5:

	A trigger fired by an INSERT statement has meaningful
	access to new column values only. Because the row is being
	created by the INSERT, the old values are NULL.
so where are you getting old and new?

if you meant UPDATE, your code still does not make sense. you cannot update all the keys in a table that causes a trigger - the old mutating table problem.

so, please RTFM, reconsider, and post your problem again.

good luck
//michael

-- 
:: michael ryan , ryan_at_xsoft.xerox.com
:: ob disclaimer: opinions expressed are not those of xerox, corp.


-- 
:: michael ryan , ryan_at_xsoft.xerox.com
:: ob disclaimer: opinions expressed are not those of xerox, corp.
Received on Wed Sep 06 1995 - 00:00:00 CEST

Original text of this message