Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Problem on trigger.
A copy of this was sent to "barthon" <developpement_at_cantoriel.fr>
(if that email address didn't require changing)
On Wed, 2 Jun 1999 19:29:34 +0200, you wrote:
>Hi,
>Can somebody help me on this error:
>
>CREATE OR REPLACE TRIGGER test
>BEFORE DELETE ON MY_TABLE
>FOR EACH ROW
>DECLARE
> i INTEGER;
>BEGIN
> SELECT COUNT(*) INTO i
> FROM MY_TABLE;
>
> DBMS_OUTPUT.PUT_LINE(i);
>END;
>
>If the SQL statement
>DELETE FROM MY_TABLE WHERE My_row1 = 'A';
>is issued, an error is returned:
>"MY_TABLE is mutating..."
>
>I'm looking for an other method to execute an SQL statement on "MY_TABLE" in
>a trigger "ON MY_TABLE".
>
>Thanks for your answers.
>
>JP
>
get rid of the "for each row" statement. The BEFORE and AFTER triggers can read the table. the row level triggers cannot.
See http://www.oracle.com/ideveloper/ for my column 'Digging-in to Oracle8i'...
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA
--
Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Wed Jun 02 1999 - 13:28:54 CDT
![]() |
![]() |