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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Trigger question

RE: Trigger question

From: <t.n.roopesh_at_orbitech.co.in>
Date: Wed, 03 Apr 2002 04:03:27 -0800
Message-ID: <F001.00439B09.20020403040327@fatcity.com>


Hi Roland,

Jus change the after trigger to before and the code works!!..

logically after insret is used to replicate data and not for data cleansing . When data cleansing is required use before insert trigger( before the data is actually inserted)

Cheers
Roopesh

   -----Original Message-----

   From:       Roland.Skoldblom [SMTP:Roland.Skoldblom_at_ica.se]
   Sent:       Wednesday, April 03, 2002 4:38 PM
   To:         ORACLE-L
   Cc:         Roland.Skoldblom

   Subject: Trigger question    

   Hallo,    

   What is wrong with this trigger:    

   I want the trigger to fire(to run the statement :    UPPER(SUBSTR(:OLD.namn, 1, 1)) || SUBSTR(:OLD.namn,2);    after new record is inserted in this table.    

   The thing to happen should be this:    

   I want that script to be run on the same record that has been    inserted in the table. So the UPPer command should run on the namn    field that has been inserted in the table.    Hope anyone can“help me.    

   CREATE OR REPLACE TRIGGER AFTER_INSERT_ROWins_ON_test    after insert

      ON test
     REFERENCING NEW AS NEW OLD AS OLD
     FOR EACH ROW

   BEGIN        :NEW.namn :=UPPER(SUBSTR(:OLD.namn, 1, 1)) || SUBSTR(:OLD.namn,2);

   END;        /        

   Thanks in advance    

   Roland S    

   --
   Please see the official ORACLE-L FAQ: http://www.orafaq.com    --
   Author:
     INET: Roland.Skoldblom_at_ica.se    

   Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051    San Diego, California -- Public Internet access / Mailing    Lists



   To REMOVE yourself from this mailing list, send an E-Mail message    to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in    the message BODY, include a line containing: UNSUB ORACLE-L    (or the name of mailing list you want to be removed from). You may    also send the HELP command for other information (like subscribing).        

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author:
  INET: t.n.roopesh_at_orbitech.co.in

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Wed Apr 03 2002 - 06:03:27 CST

Original text of this message

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