I need to create Trigger for delete action which backsup all fields old value in audit table.
I have a table structure for audit table as
id, menuid, field, oldvalue, changedone
now whenever any of the row is deleted from its mother table(menu) having 21 fields in count, every fields old value should get insert in the audit table with new audit id..
like If I delete a row having fields as:
menuid, name, age, address, sex, town
now in audit table 6 rows should get inserted seperately for every field given above as:
AUdit Table:
id=2(audittable id)
menuid = menuid
field = name
oldvalue = joy
changedone = (whatever the deleted time was)
id=3(audittable id)
menuid = menuid
field = age
oldvalue = 23
changedone = (whatever the deleted time was)
an so on..