Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Sending table as an object to procedure
In my Oracle database I have a lot of tables with the same columns
USER_CREATED, DATE_CREATED, USER_MODIFIED, DATE_MODIFIED for tracking
the processes of creation and modification of rows. Each table has it's
own trigger raising before insert and update and fulfilling already
mentioned columns:
BEGIN
IF (inserting) THEN
:NEW.user_created:=user;
:NEW.date_created:=TRUNC(sysdate);
END IF;
:NEW.user_modified:=user;
:NEW.date_modified:=TRUNC(sysdate);
END;
Each table has this same trigger. OK, this works but question is: can I
create a generic procedure that will accept the name of table as an
input argument and that will fulfill columns USER_CREATED, DATE_CREATED,
USER_MODIFIED, DATE_MODIFIED of that given table with appropriate
values.
If I have this generic procedure I do not have to change every trigger for each table if I want to change any functionality of this trigger, then I can change only generic procedure.
Finally, my problem is that I do not know how to send the table (as an object) to procedure!
-- Stjepan BrbotReceived on Thu Jul 18 2002 - 00:47:07 CDT
![]() |
![]() |