| call function generates ORA-14551: cannot perform a DML operation inside a query [message #519100] |
Tue, 09 August 2011 07:48  |
gtriant
Messages: 42 Registered: September 2006
|
Member |
|
|
Dear all,
Calling function
select PACK.MAIN('blah') from dual
generates:
ORA-14551: cannot perform a DML operation inside a query
ORA-06512: at "SYSADM.NEW_QUANTUM_PACK", line 756
ORA-06512: at "SYSADM.NEW_QUANTUM_PACK", line 245
Unfortunately the Body is not accessible to see.
The spec of the function is:
FUNCTION MAIN (mvar IN varchar2) RETURN varchar2;
I read somewhere that I can call it like:
var myVar VARCHAR2;
call PACK.MAIN('blah') into :myVar
But this generates:
ORA-01008: not all variables bound
Am I doing something wrong?
[Updated on: Tue, 09 August 2011 07:53] Report message to a moderator
|
|
|
|
| Re: call function generates ORA-14551: cannot perform a DML operation inside a query [message #519102 is a reply to message #519100] |
Tue, 09 August 2011 08:01   |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
gtriant wrote on Tue, 09 August 2011 08:48Dear all,
Calling function
select PACK.MAIN('blah') from dual
generates:
ORA-14551: cannot perform a DML operation inside a query
ORA-06512: at "SYSADM.NEW_QUANTUM_PACK", line 756
ORA-06512: at "SYSADM.NEW_QUANTUM_PACK", line 245
Unfortunately the Body is not accessible to see.
Well, it has DML in it which you can clearly not do based on the error message.
Quote:
The spec of the function is:
FUNCTION MAIN (mvar IN varchar2) RETURN varchar2;
I read somewhere that I can call it like:
var myVar VARCHAR2;
call PACK.MAIN('blah') into :myVar
But this generates:
ORA-01008: not all variables bound
Am I doing something wrong?
Even if the syntax was correct, it doesn't change the fact that function is doing DML.
|
|
|
|
|
|
|
|