Triggers: how do I access values passed into a trigger? [message #285505] |
Tue, 04 December 2007 22:48  |
leif
Messages: 2 Registered: December 2007
|
Junior Member |
|
|
Ok, I've been struggling to find out how to do this for most of the day and haven't had any luck. Any help is much appreciated!
I'm learning triggers and I would like to do a basic select on the value (partno) being inserted to get the current number of quotes for that part number. From everything I read this is the approach I should take.... but it doesn't work I get the following error. ORA-04082: NEW or OLD references not allowed in table level triggers Is it possible to do what I'm trying to do? Thanks for the help!
CREATE OR REPLACE trigger TR_min_quotes
after insert or delete on tbQuote
declare
x number;
begin
select NumberofQuotes into x
from PartQuoteCounts where partno = :new.partno;
if x < 2 then
dbms_output.put_line (
'*** Rule Violation ***');
end if;
end TR_min_quotes;
/
|
|
|
|
|
|
|
|
|
|