Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Update trigger, detecting missing columns
Chris L. wrote:
> DA Morgan wrote:
>
>>Chris L. wrote: >> >>>Hello all, >>> >>>[Oracle 9i] >>> >>>Need to detect, in a "before update for each row" trigger, if a >>>specific column had a value informed on the SQL statement. >>> >>>Example: Table ZZ with A, B, C columns >>> >>>update table ZZ set C=1 where A=2; (column B wasn't informed) >>> >>>update table ZZ set C=1,B=3 where A=2; (column B was informed) >>> >>>Assume both sentences hit one record. (A=Primary key) >>> >>>looking at :new.B doesn't help because that holds the value for B on >>>that record. >>>(If the record is A=2, B=1000, C=3, then :new.B evaluates to 1000 on >>>the first update and to 3 on the second update). >>> >>>Any way to do it? >>>Thanks in advance >>>Cris >> >>This request makes little sense. What is it you are actually trying >>to do? And why? >> >>What is it that :OLD and :NEW can't do that you actually need?
Then what's wrong with:
IF :NEW.bonus IS NULL THEN
or
IF :NEW.bonus IS NULL and :OLD.bonus IS NOT NULL THEN
I still don't see what it is you are trying to do that you don't already have the tools to handle.
-- Daniel A. Morgan http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Tue Dec 20 2005 - 18:03:16 CST
![]() |
![]() |