有两个表空间a,b
a---用户:a1
b---用户:b1
从a表空间中,写存储过程引用b表空间的表,该如何写
我写的是:
create or replace procedure pro_initdatas
as
begin
insert into b.table1 cc(cc.n1,cc.n2,cc.n3)
select tc.n1,tc.n2,tc.n3 from table2 tc;
commit;
end;
/红色字体的引用有问题,该怎么引用?
a---用户:a1
b---用户:b1
从a表空间中,写存储过程引用b表空间的表,该如何写
我写的是:
create or replace procedure pro_initdatas
as
begin
insert into b.table1 cc(cc.n1,cc.n2,cc.n3)
select tc.n1,tc.n2,tc.n3 from table2 tc;
commit;
end;
/红色字体的引用有问题,该怎么引用?
create database link dblinkb1 connect by b1 identified by 密码 using '用户b1所在实例名';
然后用b1.table1@dblinkdb1的方式在a1中引用。
grant select, insert on table1 to a;