declare
cursor tb1 is select t."name" as name from sysdatabases@master t
where t."name" like 'USER%' order by t."name";
begin
for i in tb1
loop
dbms_output.put_line(i.name);
execute immediate 'create public database link '||i.name||' connect to sa
identified by "sa" using' ||
'''(description = (address_list=(address=
(protocol=tcp)(host=127.0.0.1)(port=1521)))
(connect_data=(sid='''||i.name||'''))(hs=ok))''';
end loop;
end;
我想循环创建透明网关.. 请问 这个语句应该怎么写 每次都是那个i.name有错误。。我SQL SERVER里有一堆USER开头的数据库
现在这里感谢了
cursor tb1 is select t."name" as name from sysdatabases@master t
where t."name" like 'USER%' order by t."name";
begin
for i in tb1
loop
dbms_output.put_line(i.name);
execute immediate 'create public database link '||i.name||' connect to sa
identified by "sa" using' ||
'''(description = (address_list=(address=
(protocol=tcp)(host=127.0.0.1)(port=1521)))
(connect_data=(sid='''||i.name||'''))(hs=ok))''';
end loop;
end;
我想循环创建透明网关.. 请问 这个语句应该怎么写 每次都是那个i.name有错误。。我SQL SERVER里有一堆USER开头的数据库
现在这里感谢了
where name like 'USER%' order by name;
这样试试!
你口令加了引号,用户应该也是要引号的吧(否则会自动转成大写的)
sid后面需要引号吗?