In my application users can update some datas. And I want to save all updated columns with their values in AG_TABLE_UPDATE_HISTORY table. The table's structure is like that:
CREATE TABLE "AG_TABLE_UPDATE_HISTORY"
(
"TABLE_NAME" VARCHAR2(20 BYTE),
"ROW_ID" VARCHAR2(20 BYTE),
"COLUMN_NAME" VARCHAR2(20 BYTE),
"PREVIOUS_VALUE" VARCHAR2(20 BYTE),
"CURRENT_VALUE" VARCHAR2(20 BYTE)
)
I know that, I can get updated column's names by comparing :old
and :new
columns one by one in BEFORE UPDATE trigger
.
But, I want to know is there any better way which is offered to us by Oracle?