Saturday, May 3, 2008

So I have found myself in a pickle, and you’re going to love this. So I have a function on a server called FuncThatSmells. On this server, I have a database link to RAC1. On RAC1 I have another function called TestThisCrap.



create or replace
FUNCTION TestThisCrap RETURN VARCHAR2 AS
BEGIN
EXECUTE IMMEDIATE 'TRUNCATE TABLE ODS0_FIN.F_NOTE';
RETURN 'here';
EXCEPTION
WHEN OTHERS
THEN
NULL;

RETURN 'there';
END ;


create or replace
FUNCTION FuncThatSmells RETURN VARCHAR2 AS
v_Return VARCHAR2(4000);
BEGIN
v_Return := FUNCTEST@something.COM;
DBMS_OUTPUT.PUT_LINE('PSQLCODE = ' v_Return);
END;



Now you’re going to love this. The issue is when I run this I get a message

ORA-02064: distributed operation not supported



From the forums, http://forums.oracle.com/forums/thread.jspa?messageID=1977703, I get this
.
.
.
ORA-02064: distributed operation not supported
Cause: One of the following unsupported operations was attempted:
1. array execute of a remote update with a subquery that references a dblink, or
2. an update of a long column with bind variable and an update of a second column with a subquery that both references a dblink and a bind variable, or
3. a commit is issued in a coordinated session from an RPC procedure call with OUT parameters or function call.
Action: simplify remote update statement
.
.
.


BAND MY HEAD ON THE KEYBOARD…………

No comments: