I was trying to prove a point about APEX across database links but messed up my demo.
If the code lives on the database with APEX installed, then you can't use database links with the RETURNING clause.
Now I create the code in my schema referencing the objects using database links.
CREATE SEQUENCE sq_tThe function compiles normally, but when you try and run it...
START WITH 100
INCREMENT BY 1
CACHE 10
NOCYCLE;
CREATE OR REPLACE
FUNCTION create_t
( p_first_name IN VARCHAR2,
p_last_name IN VARCHAR2 ) RETURN NUMBER
IS
l_id NUMBER;
BEGIN
INSERT INTO t@my_application
( id,
first_name,
last_name )
VALUES
( sq_t.nextval,
p_first_name,
p_last_name )
RETURNING id INTO l_id;
RETURN l_id;
END create_t;
/
show errors
CJUSTICE@TESTING>var c number;Voila!
CJUSTICE@TESTING>exec :c := create_t( 'chet', 'justice' );
BEGIN :c := create_t( 'chet', 'justice' ); END;
*
ERROR at line 1:
ORA-22816: unsupported feature with RETURNING clause
ORA-06512: at "CJUSTICE.CREATE_T", line 7
ORA-06512: at line 1
No comments:
Post a Comment