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: Goulet, Dick <DGoulet_at_vicr.com>
Date: Thu, 08 Jan 2004 11:54:35 -0800
Message-ID: <F001.005DC2BA.20040108115435@fatcity.com>


Wolfgang,

        Yes you may, within the trigger only, change values of that row only. it's known as

        :new.<column_name> := <whatever>;

Dick Goulet
Senior Oracle DBA
Oracle Certified 8i DBA

-----Original Message-----
Sent: Thursday, January 08, 2004 2:39 PM To: Multiple recipients of list ORACLE-L

I'm sure I will be corrected if I'm wrong. Answers inline

At 12:24 PM 1/8/2004, you wrote:

>Hi All,
>
>Firstly my apologies if this seems like a very *stupid* question but I'm a
>tad confused (and it's late in the evening)
>
>When an AFTER INSERT trigger is fired (row level) has the row been committed
>to the database at this stage?

No. You could raise an error as part of what the trigger does in order to reject the action.

>If so is it ok to call a package in the trigger that selects that row and
>changes some values in the row?

  1. it is not so and
  2. you can not do anything with that row (or that table for that matter) in either the trigger or any called package or procedure. You'll get a "mutating table" error.

>Thanks,
>
>N.
>

Wolfgang Breitling
Oracle7, 8, 8i, 9i OCP DBA
Centrex Consulting Corporation
http://www.centrexcc.com

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Wolfgang Breitling
  INET: breitliw_at_centrexcc.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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.net
-- 
Author: Goulet, Dick
  INET: DGoulet_at_vicr.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
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 Thu Jan 08 2004 - 13:54:35 CST

Original text of this message

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