Saturday, July 20, 2013

Oracle Trigger to Log column level changes of Table

The requirement was to log changes to columns on any table to a common table. The information to be recorded was Table Name, Column Name, Action (Deletion, Insertion, and Modification), Old Value, New Value, Modified User, Modified Time and Modified PC.
The solution I came up with is to create the triggers on table using a script that trigger that fires on Update Delete and Insert. This trigger sends the information to a function that checks for changes. In the function if there are changes it will be logged to the Audit table. When calling the function I checked for the ‘Action’ and according to that change the information send to it.

Saturday, July 13, 2013

How to prevent user from double clicking button on a web application

I faced with situations where users click a button on a web application, and before the request was processed and response comes to the client user clicks again. This may produce inconsistent and unexpected results. A calculation will be performed twice or an entry is posted twice.
In order to prevent this I used was disabling the button until the response using java script.