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

Home -> Community -> Usenet -> c.d.o.misc -> Triggers on Oracle7 - newbie

Triggers on Oracle7 - newbie

From: Keith <keith.wilby_at_AwayWithYerCrap.com>
Date: 22 Mar 2005 10:41:21 GMT
Message-ID: <Xns96216D64CAF11keithwilby@10.15.188.42>


Hi. This is my first posting to an Oracle forum, please be patient with me, I'm a clueless newbie in Oracle.

I want to create a trigger that updates a field when the contents of another field changes. I've tried two approaches but they both won't compile:

create or replace trigger t_oms_arr_af

	before insert or update
	of ver_arr_status
	on oms_version_tbl
begin
	if ver_arr_status = 'PASSED' then
		update oms_version_tbl
		set ver_arr_act_fin = sysdate;
	end if;

end t_oms_arr_af;
/

show errors

create or replace trigger t_oms_arr_af

	before insert or update
	of ver_arr_status
	on oms_version_tbl
begin
	if :new.ver_arr_status = 'PASSED' then
		update oms_version_tbl
		set ver_arr_act_fin = sysdate;
	end if;

end t_oms_arr_af;
/

show errors

The second one gives the error "NEW or OLD references not allowed in table level triggers". I'm using Oracle 7.

Thanks.
Keith. Received on Tue Mar 22 2005 - 04:41:21 CST

Original text of this message

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