How to get current rowid in trigger when update statement is fired
396540May 31 2004 — edited May 31 2004Hi,
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!