Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Sending table as an object to procedure

Sending table as an object to procedure

From: Stjepan Brbot <stjepan.brbot_at_zg.hinet.hr>
Date: Thu, 18 Jul 2002 07:47:07 +0200
Message-ID: <ah5lhm$7qi4$2@as201.hinet.hr>


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 Brbot
Received on Thu Jul 18 2002 - 00:47:07 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US