DML Statement in Function [message #318545] |
Wed, 07 May 2008 02:45  |
hasnainlakhani
Messages: 24 Registered: January 2007
|
Junior Member |
|
|
I use DML Statement in Function . When I execute the function it gives me error that "Cannot Perform DML Operation Inside a Query"
How can I resolve this problem. Is there any way to use DML statement using Function (Not Procedure)
|
|
|
Re: DML Statement in Function [message #318548 is a reply to message #318545] |
Wed, 07 May 2008 02:51   |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
You CAN use DML in a function, but then you can only use the function in PL/SQL, NOT directly in an SQL Query.
e.g.
....
v_val := function(parameter);
....
in PL/SQL will work, using
select function(parameter)
from .......
directly in SQL will not work.
So there is no workaround for the "Cannot Perform DML Operation Inside a Query"
[Updated on: Wed, 07 May 2008 02:51] Report message to a moderator
|
|
|
|
Re: DML Statement in Function [message #318578 is a reply to message #318551] |
Wed, 07 May 2008 03:40   |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Don't like that advice..
Considering the fact that the original poster did not understand why he could not do DML in a function called from SQL, we would not want him to go on the dangerous path of autonomous transactions.
|
|
|
|
|