Home » SQL & PL/SQL » SQL & PL/SQL » Mutating tables
Mutating tables [message #204810] Wed, 22 November 2006 03:47 Go to next message
odjono
Messages: 2
Registered: November 2006
Junior Member
Hello !'
I've a trigger. Inside the trigger there is call to
a method. In this method there is a cursor that is selecting from the same table that the trigger is run from. The method will then not be executed ...? No error is returned, I'll guess this is regarding the mutating tables problem. Not possible to run a trigger with inserting a table and then select from the same table ?

The trigger :

create or replace trigger TRG_INS_APO_TRANS_HISTORY
after insert on inventory_transaction_hist_tab
for each row
declare
PRAGMA AUTONOMOUS_TRANSACTION;
new_stat_year_no_ NUMBER;
new_stat_period_no_ NUMBER;
begin
IF :new.date_applied is not null THEN
Apo_Statistic_Util_API.Find_Period(new_stat_year_no_,
new_stat_period_no_,:new.date_applied);

-- odjono: Inside this method there is a cursor that is
-- selecting from inventory_transaction_hist_tab ->
Apo_Statistic_Util_API.Update_Statistic(:new.contract,
:new.part_no,
:new.configuration_id,
:new.transaction_code,
new_stat_year_no_,
new_stat_period_no_);
END IF;
end TRG_INS_APO_TRANS_HISTORY;


Any suggestions how this can be handled without doing modification in the method, only in the trigger?

Best regards !!

Odd Inge
Re: Mutating tables [message #204839 is a reply to message #204810] Wed, 22 November 2006 06:03 Go to previous messageGo to next message
odjono
Messages: 2
Registered: November 2006
Junior Member
Well, some search in the forum and I think a solution soon is ready.
Re: Mutating tables [message #204946 is a reply to message #204810] Wed, 22 November 2006 16:37 Go to previous message
rikfair
Messages: 22
Registered: October 2006
Location: UK
Junior Member
Hi
The article in the link contains an example of how to work around the mutating tables issue.

http://www.astral-consultancy.co.uk/cgi-bin/hunbug/doco.cgi?11010

Hope this helps
Razz
Previous Topic: Store currency into table
Next Topic: parent child relationship?
Goto Forum:
  


Current Time: Fri Dec 09 11:59:39 CST 2016

Total time taken to generate the page: 0.11195 seconds