Skip to Main Content

Oracle Database Discussions

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!

How to get current rowid in trigger when update statement is fired

396540May 31 2004 — edited May 31 2004
Hi,

I am writing a trigger which fires on the update statement. This is for auditing and since i need old value as well as new value, I have created a package and defined a plsql table in it with rowid as its only column type.


I have written a statment level before update trigger which empties the plsql table.

Then i have written an before update row level trigger which populates the current rowid into the the plsql table.

The problem I am facing here is accessing rowids and populating it in the plsql table.

I can't write like this:

myPackage.myPlSQLtbl(myPackage.v_count) = RowID
myPackage.vCount = myPackage.vCount + 1;

Because I get error like row id is accessible only through select statement.

So how do i achieve this ?

Will creating a cursor solves this problem ?

Thanks in the anticipation that i will get some hint to solve thie problem.

Cheers!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2004
Added on May 31 2004
4 comments
2,887 views