Title: RE: Trigger question

This should work:

CREATE TRIGGER "BEFORE_ROWUPD_ON_TEST"
  BEFORE UPDATE OF namn
  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);
EXCEPTION
  WHEN OTHERS THEN
    raise_application_error(-20000, 'ERROR IN TRIGGER BEFORE_ROWUPD_ON_TEST: ' || SQLERRM);
END;
/

Med v�nliga h�lsningar/ Kind regards
----------------------------------------------------------------------
Veriba AB
Per Bergh�ll
Brigadgatan 10
581 31 Link�ping
Tel: +46 (0)13-362600
Fax: +46 (0)13-362625
mailto:[EMAIL PROTECTED]
http://www.veriba.se
----------------------------------------------------------------------

    ----------
    Fr�n:   [EMAIL PROTECTED][SMTP:[EMAIL PROTECTED]]
    Svara till:     [EMAIL PROTECTED]
    Skickat:        Thursday, March 28, 2002 12:33 PM
    Till:   Multiple recipients of list ORACLE-L
    Ang�ende:       Trigger question

    Hallo,

    anyone who can please helpme with a trigger script that does the following:

    I want  this script to run when I have updated a field in a table.

    update test set namn = upper(substr(namn,1,1) || substr(namn),2)

    I want this trigger to fire only for the selected record(row), that is going to be updated. Please help me with this, it might seem simple but I cant get it right.

    Thanks in advance

    Roland S

    --
    Please see the official ORACLE-L FAQ: http://www.orafaq.com
    --
    Author:
      INET: [EMAIL PROTECTED]

    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: [EMAIL PROTECTED] (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).

Reply via email to