wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Please help..triggers issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Please help..triggers issue" Watch "Please help..triggers issue" New topic
Author

Please help..triggers issue

Aman Gupta
Greenhorn

Joined: Nov 12, 2008
Posts: 10
Hi,
I have a requirement of a trigger which will trim the value of column CAA_NAME as soon as this column is updated.
I hv written the foll trigger to achieve the same.

But after the trigger is configured and i try to update caa_name column, I'm getting -

ora-04091: table caa_ca is mutating,trigger-function may not see it
ora-06512: at "TRIMCAACC4_MAIN", line 2
ora-04088: error during execution of trigger


Please Help.



CREATE OR REPLACE TRIGGER TRIMCAACC4_MAIN
AFTER UPDATE OF
CAA_NAME
ON
CAA_CA
REFERENCING NEW AS NEW
FOR EACH ROW
BEGIN
UPDATE CAA_CA SET
CAA_NAME = TRIM(:NEW.CAA_NAME)
WHERE CAA_CA_ID=:NEW.CAA_CA_ID ;

END;
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9953
    
163

Please do not post the same question in multiple forums. Let's continue this discussion in your other thread at http://www.coderanch.com/t/415548/JDBC/java/Please-help-triggers


[My Blog] [JavaRanch Journal]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Please help..triggers issue
 
Similar Threads
getting error while droping the user in oracle.
using :new in oracle JDBC Query
Please help...triggers issue
modifing data when Trigger fires
help required in writing row level trigger?