Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: ORA-14551: cannot perform a DML operation inside a query
Hi Daud,
you have to define your function with pragma autonomous_transaction.
Regards,
Martin
Daud wrote:
>
> Hi
>
> I have written a pl/sql function that returns a value.
> The function will insert or update into a table everytime it is
> called.
> However, everytime I call the function from a select statement like:
>
> select getVal('data') from dual;
>
> I got an error message like below.
>
> ORA-14551: cannot perform a DML operation inside a query
>
> I think I understand why. However, is there a workaround to this
> problem? I need to call the function from a select statement and the
> function needs to insert/update a table.
>
> thanks
> Daud11
Received on Thu Aug 23 2001 - 11:53:43 CDT