Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Workaround for ORA-14551 WHILE CALLING FUNCTION IN SQL OVER DBLINK

698658Nov 5 2012 — edited Nov 6 2012
Hi,
any idea how to workaround such issue in 9.2.0.8 (I know this is working with 11.2).
create table mylog(id number, data date , mess clob);

create or replace function myfunc(id in number, data in date ,mess in varchar2)
return number is
pragma autonomous_transaction;
retval number;
begin
   insert into mylog values (id , data ,mess);
commit;
retval := id;
return retval;
end;
/


SQL> select schema.myfunc@dblink(2,sysdate,'bbbbbbb') from dual;
       *
ERROR at line 1:
ORA-14551: cannot perform a DML operation inside a query
ORA-06512: at "SCHEMA.MYFUNC", line 6
ORA-06512: at line 1
Regards
GregG
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 4 2012
Added on Nov 5 2012
8 comments
1,277 views