Re: :new and :old
:new and :old -- Mercadante, Thomas F 2005-06-16
:new and :old -- Kean Jacinta 2005-06-16
:new and :old -- Niall Litchfield 2005-06-17
I think that I would be sorely tempted to audit all the changes, and use the master table at reporting time to decide what I wish to report on. I'm pretty sure that your approach (dynamically build an audit strategy), particularly if you are potentially doing this for all tables in your schema will lead to you missing something that you wish to audit at a later date.
On 6/16/05, Kean Jacinta <firstname.lastname@example.org> wrote:
Yes i am trying to create a trigger that track changest made on employee_tbl.Our database is created in such a way that all the table and fieldname that need to be track will be stored in AUDITTABFLD table. This audit table field contains , tablename and fieldname that needs to be audited.
If the trigger is triggered by a INSERT/UPDATE statement on employee_tbl , then it will read audittabfld.To see if this table needs to be audited. If in this case, the table existed in AUDITTABFLD then the trigger will have to retrieve all the fieldname to be audited, and log all the field name before and after value into EMPLOYEE_LOG_TBL. So in my triggers i have created a cursor to read the fieldname and then loop the statement.
I encounter some problem in assigning the OLD and NEW value. Error will occur then i tried to do this :OLD.<fieldname> :NEW.<fieldname>
Since the cur1 will return more than one value , then i need it to be dynamic.
I hope you can understand what i am trying to explain here.:)
i have declare a cursor in my trigger called cur1. I
am trying to refer :OLD.
:NEW. from the cursor. I got an
PLS-00049 bad-bind variable. I am not sure if oracle
support this. If this way is not gonna work then what
can you pls suggest other method to acheive the same
CURSOR cur1 IS
WHERE TRACKTABLENAME =3D 'COMPANY_MASTER'
FOR cur1_rec IN cur1
INSERT INTO AUDITLOG =20
Have fun online with music videos, cool games, IM and more. Check it
Use Yahoo! to plan a weekend, have fun online & more. Check it out!