Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Oracle / Oracle Server / March 2006

Tip: Looking for answers? Try searching our database.

Trigger Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Zaccaria - 31 Mar 2006 08:16 GMT
Hi
I'm not e good trigger programmer but
I want to make a trigger that when I update or insert one record in
table, the trigger check the values of a field, and if it is
equal at one prefixed vales, the trigger update another field.

I have TO make this:

create or replace trigger catchupwith
  after insert or update on TABLE
  for each row
declare

  REC_N TABLE%ROWTYPE;

begin

   SELECT *
     INTO REC_N
     FROM TABLE
    WHERE ITEM = :NEW.ITEM;

    IF REC_N.FIELD_A = 'P'  THEN
      UPDATE TABLE SET FIELD_B = '1' WHERE ITEM = REC_N.ITEM ;
    END IF;

end catchupwith;

unfortunately it not run because the table is open in update
"ORA-04091:table string.string is mutating, trigger/function may not see
it."

I don't know what I do?

Thanks For Help

I work with Oracle 7.3.4 on Solaris

Zacc
frank.van.bortel@gmail.com - 31 Mar 2006 08:35 GMT
Search for Mutating Table - it's a standard problem, with a standard
solution, and has been presented numerous times
Zaccaria - 31 Mar 2006 08:50 GMT
frank.van.bortel@gmail.com ha scritto:
> Search for Mutating Table - it's a standard problem, with a standard
> solution, and has been presented numerous times

Sorry for my inexperience
Thanks you for help :-)
Matthias Hoys - 31 Mar 2006 10:16 GMT
> I work with Oracle 7.3.4 on Solaris
>
> Zacc

Is that for real ?? 7.3.4 has been desupported for ages now.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.