Audit information and user id management
Hi Experts,
I am trying to build a simple audit region for my application which would record changes like:
Created by:
Created on:
The way I would go about this would be to use a BEFORE INSERT trigger with something like:
new.created_by := nvl(wwv_flow.g_user,user).
However, my tasks table has a column named CREATED_BY which is NUMBER column and its FK to TASK_USERS table. This means that when the above trigger fires it will try to insert a username into a number column... and ofcourse fail.
Is there a way to create somekind of LOV for a trigger? What I would like to achive is that a username will be automatically converted to the user ID and that would be inserted into CREATED_BY (NUMBER) column...
Or does anyway has other ideas?
Thanks for any help,
Pawel.