Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Update column having before update trigger

spur230Aug 29 2013 — edited Aug 29 2013

I am using Oracle 11.2.0.3. Please see the example below:

  create table table1 (id number, updt_ts timestamp);

 

   CREATE OR REPLACE TRIGGER table1_U_TR

   BEFORE UPDATE

   ON table1

   FOR EACH ROW

BEGIN

   :NEW.UPDT_TS := LOCALTIMESTAMP;

END;

/

insert into table1 (id) values (1);

update table1 set updt_ts = trunc(sysdate)-2 where id =1

select * from table1;

I need to update table1.updt_ts other than localtimestamp. However, when i issue an update statement like above, the trigger updates it to localtimestamp.

Since the user i am working with does not have disable/drop trigger privilege, is there any other easy way to  override the trigger and put some other value?

Many thanks for your time.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 26 2013
Added on Aug 29 2013
3 comments
453 views