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

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

Trigger question

From: <Roland.Skoldblom_at_ica.se>
Date: Wed, 03 Apr 2002 03:08:19 -0800
Message-ID: <F001.00439A67.20020403030819@fatcity.com>


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);
-- :NEW.namn := UPPER(SUBSTR(:OLD.namn, 1, 1) || SUBSTR(:OLD.namn), 2);
EXCEPTION
  WHEN OTHERS THEN
    raise_application_error(-20000, 'ERROR IN TRIGGER AFTER_INSERT_ROWins_ON_test: ' || SQLERRM);

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). Received on Wed Apr 03 2002 - 05:08:19 CST

Original text of this message

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