471,316 Members | 1,342 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,316 software developers and data experts.

Trigger giving exception ORA-04091

The Trigger is giving following exception

java.sql.SQLException: ORA-04091: table PSCONTENT.VGNASCHANNEL is mutating, trigger/function may not see it ORA-06512: at "PSCONTENT.CHECK_CHANNEL_UNPUBLISH", line 4 ORA-06512: at "PSCONTENT.CHECK_CHANNEL_UNPUBLISH_TR", line 1 ORA-04088: error during execution of trigger ................................

// Trigger
CREATE OR REPLACE TRIGGER check_channel_unpublish_tr
before delete
ON vgnaschannel
for each row
check_channel_unpublish( :old.id )
;
/



// Procedure
CREATE OR REPLACE procedure check_channel_unpublish( p_channelId in char ) as
n int;
begin
select count(*) into n
from vgnAsChannel
where parentChannelId = p_channelId;
if ( n > 0 ) then
raise_application_error(
num => -20052,
msg => ( 'attempt to unpublish channel that is referenced by still-published subchannels; id=' || p_channelId ) );
end if;
select count(*) into n
from vgnAsChannelFileAssociation
where channelId = p_channelId;
if ( n > 0 ) then
raise_application_error(
num => -20053,
msg => ( 'attempt to unpublish channel that has ' || n || ' still-published objects associated with it' ) );
end if;
end;
/
Jul 6 '07 #1
2 6056
debasisdas
8,127 Expert 4TB
Your case is a mutating trigger error.

this happens when the trigger tries to modify the base table from which it is reading data.
Jul 6 '07 #2
Your case is a mutating trigger error.

this happens when the trigger tries to modify the base table from which it is reading data.

Thanks for the reply.

But my problem is that, I cannot modify the Trigger neither can i disable it as this trigger is written in a CMS tool which i m using.

Is there any way of achieving the same functionality by writting any DB query/ procedure etc.

Hemant
Jul 6 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Scott J. Chlebove | last post: by
4 posts views Thread by Mike Stenzler | last post: by
2 posts views Thread by BJerolimic | last post: by
1 post views Thread by umesh049 | last post: by
2 posts views Thread by Mike Stenzler | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.