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!

After insert trigger with :NEW.ROWID

mail8mzNov 27 2013 — edited Nov 27 2013

Hi All,

I am using a After insert trigger to generate history record as following:

CREATE TABLE TB_TEST (classID number(3), classNm varchar2(12));

CREATE TABLE TB_HIST_TEST (hist_dttm timestamp(6), classID number(3), classNm varchar2(12));

CREATE or REPLACE TRIGGER air_test AFTER INSERT ON tb_test FOR EACH ROW

BEGIN PK_SRVC.CRT_NewRec('TB_TEST', 'TB_HIST_TEST', :new.ROWID); END:

In PK_SRVC package, I use the following statment to create new record in TB_HIST_TABLE:

     Insert into tb_hist_test (hist_dttm, classID, classNm)

     values (select systimestamp, classID, classNm from tb_test where rowid = ROWID )

The trigger DOES fire when a new row is inserted into TB_TEST. However there is no record inserted into TB_HIST_TEST. Any suggestion?

Thanks,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 25 2013
Added on Nov 27 2013
4 comments
1,650 views