You probably can make it more dynamic. You can use the data dictionary to see what columns belong to the table and use "execute immediate" to dynamically execute the trigger code.
I would never do it that way for several reasons:
You cannot compile the dynamic code, so you don't know until run time if there is an error in your dynamic pl/sql.
Dynamic pl/sql is always slower than compiled code.
Execute immediate is vulnerable to sql injection if you are not careful.
What you can do is create a generator that generates the trigger code. When you change the table, you just run the generator again and it will create a new trigger.
You say you store the changes in an additional column in the same table. What happens if you do more than one change? And what happens when you delete the whole record?
Sorry for the delay. I am concatinating the columns with comma that are changed. Like column1||','||column2 and while retrieving i am considering one column at a time using SQL functions in post query using a loop to set the Visual Attribute property of the item. Can we make it more dynamic? Any suggestions?
Ok, but what do you do when the record is updated twice? Are the new changes concatenated to the earlier ones? In general, you use something like an audit-table for this kind of requirement.
Yes whenever the end user updates a column in main table, i am inserting a new record into audit table. So if a user updates only 1 column i am saving that column name into one column, if he updates 5 columns i will concatenate 5 columns and save in that column.