Hi All,
I want to access and assign value to variable and type declared inside procedure of remote schema via db from my schema.
Eg. below code is in the main schema[REMOTETEST1] for processing
create package mytest
g_value myType;
rec_op myType;
function execprocess(rec_op out myType )
return boolean;
I want to assign value for g_value from my schema which is in different database using DB Link.
In my schema[TEST1],
REMOTETEST1.mytest@DBLINK.g_value:=VALUE;
Create get/set methods inside the package to manipulate it:
create database link loopback using '//localhost:1521/orcl';
create or replace package mytest is
g_value int;
function get_val return int;
procedure set_val ( val int );
end mytest;
/
create or replace package body mytest is
function get_val return int as
begin
return g_value;
end;
procedure set_val ( val int ) as
begin
g_value := val;
end;
end mytest;
/
exec mytest.set_val@loopback ( 1 );
select mytest.get_val@loopback from dual;
GET_VAL
1