Home » SQL & PL/SQL » SQL & PL/SQL » Functions
Functions [message #238773] Sat, 19 May 2007 23:06 Go to next message
akkumar81
Messages: 144
Registered: February 2007
Location: india
Senior Member

Dear Friends,

Is possible pragma autonomous_tranaction inside function declarations,and when mutation occur in functions.Sample
programs is better to me..

Arun..
Re: Functions [message #238788 is a reply to message #238773] Sun, 20 May 2007 00:17 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

./fa/1580/0/

Regards
Michel
Re: Functions [message #238805 is a reply to message #238788] Sun, 20 May 2007 02:12 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Mutating triggers are practically always the result of a bad design.
The way to solve them is to change the design, not use tricks in your code. Using autonomous transactions in trigger code is extremely hazardous, as triggering events (eg an insert triggering your autonomous transaction) may be rolled back. Your autonomous transaction already did a commit, so your data is corrupted.
Re: Functions [message #238806 is a reply to message #238805] Sun, 20 May 2007 02:19 Go to previous messageGo to next message
akkumar81
Messages: 144
Registered: February 2007
Location: india
Senior Member

Dear frank,

Mutation is also possible in function?

please some code..
Re: Functions [message #238807 is a reply to message #238806] Sun, 20 May 2007 02:27 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Frank, if you understand the question you're a genius. ./fa/1578/0/

Regards
Michel
Re: Functions [message #238812 is a reply to message #238773] Sun, 20 May 2007 02:49 Go to previous messageGo to next message
akkumar81
Messages: 144
Registered: February 2007
Location: india
Senior Member

dear friend,

In trigger concepts mutation occurs on some situations..
so i ask is possible in function? what's wrong to me..

Re: Functions [message #238813 is a reply to message #238812] Sun, 20 May 2007 02:56 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Ok, it seems you don't understand the concept of "mutating table".
What is it for you? Post what you understand and we will correct what is wrong.

Regards
Michel
Re: Functions [message #238815 is a reply to message #238773] Sun, 20 May 2007 03:04 Go to previous messageGo to next message
akkumar81
Messages: 144
Registered: February 2007
Location: india
Senior Member



I have some doubts functions related..DML operation are included in function ?and is possible means mutation is also possible ? i think.. afterthat function return values use OUT MODE?
Its clear..

Re: Functions [message #238818 is a reply to message #238815] Sun, 20 May 2007 03:26 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
DML operation are included in function ?and is possible means mutation is also possible ?

Yes if DML leads to a trigger execution and this one can lead to a mutating table error.

I don't understand the last part of your post.

Regards
Michel
Re: Functions [message #238957 is a reply to message #238773] Mon, 21 May 2007 01:21 Go to previous messageGo to next message
caliguardo
Messages: 107
Registered: February 2007
Location: Chennai
Senior Member

Yes, Off Course , If you use a DML statement in a Procedure which causes a triggering event to occur, you may get mutating table issue. Also that should be handled by proper design as told by Frank.

Also you can use Pragma Autonomous transaction in a Function or Procedure. This is mainly used for Troubleshooting purpose.
Re: Functions [message #238971 is a reply to message #238957] Mon, 21 May 2007 01:34 Go to previous message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
http://www.orafaq.com/forum/fa/596/0/
Arun,
you are really testing the moderators' patience here.


http://www.orafaq.com/forum/fa/448/0/

Closed.

MHE
Previous Topic: calling functions
Next Topic: Create a temp table from an existing table
Goto Forum:
  


Current Time: Sun Dec 04 23:03:57 CST 2016

Total time taken to generate the page: 0.10909 seconds