Hi Every one,
i have created Trigger & Audit Table for Destination Table .
My query is if i deleted or updated / inserted on destination table and trigger fired and its stored in Audit table .
how can i undo the DML changes latest records using with cursor ,
- how can i pull data from Audit table and restored in Destination Table .
- i have to check only last transaction in Audit table and restored in destination table ,passing POLICYNO as parameter.
DESTINATION TABLE.
RowNo CLAIMTYPE POLICYNO
20090 I NP000710
20089 I N000710
20090 I BP000710
20089 I BP000710
20090 I DP000710
AUDIT TABLE
Rowid ModDate ModBy Action RowNo CLAIMTYPE POLICYNO
1 2018-03-06 04:48:54.043 SYS\Raj UO 20090 I BP000710
2 2018-03-06 04:48:54.043 SYS\Raj UO 20089 I DP000710
3 2018-03-06 04:48:54.043 SYS\Raj UN 20090 I SP000710
4 2018-03-06 04:48:54.043 SYS\Raj UN 20089 I GP000710
5 2018-03-06 04:48:54.047 SYS\Raj D 20090 I DP000710
Can any one help me on this.
Thanks
rajnidas