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 -> Create trigger script

Create trigger script

From: Marcin Wojcicki <wojcicki_at_gsg-berlin.de>
Date: Thu, 11 Nov 1999 15:12:02 +0100
Message-ID: <382ACEB2.DE374B46@gsg-berlin.de>


Hi,
Does anyone know the address with sql scripts samples?

I have trigger which I want to set for about 90 tables, its is like this :



FOR EACH ROW
DECLARE
  typ          INTEGER;
  UsrId        INTEGER;
  ---------------------------------

BEGIN
 IF updating  THEN typ := 1; END IF;
 IF deleting  THEN typ := 2; END IF;
 IF inserting THEN typ := 3; END IF;

 SELECT USER_ID into UsrId FROM VPW_SYS_ACTPARAM;  IF typ=2 THEN

    VPW_P_InsertDelInLogFile (:OLD.ID,UsrId);  ELSE

    VPW_P_InsertUpdtInLogFile (:NEW.ID,UsrId,Typ,'ART_ID'  ,:OLD.ART_ID

,:NEW.ART_ID);

    VPW_P_InsertUpdtInLogFile (:NEW.ID,UsrId,Typ,'NAME' ,:OLD.NAME
,:NEW.NAME);

but the procedure VPW_P_InsertUpdtInLogFile in update and insert part should be started for each field in table.

I am sure that there is a method to create the trgers script automaticly.

I hope you can help me with it.

Thanks,
Marcin Received on Thu Nov 11 1999 - 08:12:02 CST

Original text of this message

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