oracle dblink调用SQL SERVER存储过程,有具体样例吗
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle dblink调用SQL SERVER存储过程,有具体样例吗相关的知识,希望对你有一定的参考价值。
一个带参数的存储过程。SQL> CREATE OR REPLACE PROCEDURE HelloWorld1 (
2 p_user_name VARCHAR2
3 ) AS
4 BEGIN
5 dbms_output.put_line('Hello ' || p_user_name || '!');
6 END HelloWorld1;
7 /
Procedure created.
SQL> CREATE OR REPLACE PROCEDURE CallHelloWorld1 (
2 p_user VARCHAR2
3 ) AS
4 BEGIN
5 -- 调用存储过程的 存储过程
6 HelloWorld1(p_user);
7 END CallHelloWorld1;
8 /
Procedure created.
执行
SQL> set serveroutput on
SQL> exec CallHelloWorld1( 'Tom' );
Hello Tom!
PL/SQL procedure successfully completed. 参考技术A 做透明网关,网上一搜一大把,不谢
『ORACLE』 DBLINK(11g)
使用tnsnames.ora
SQL> grant create database link to scott;
Grant succeeded.
SQL> conn scott/tiger
Connected.
SQL> create database link lk connect to hr identified by hr using ‘enmo1‘;
Database link created.
SQL> select * from [email protected];
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
COUNTRIES TABLE
DEPARTMENTS TABLE
EMPLOYEES TABLE
EMP_DETAILS_VIEW VIEW
EMP_SAL_CHANGE TABLE
JOBS TABLE
JOB_HISTORY TABLE
LOCATIONS TABLE
REGIONS TABLE
SP_LOGERR TABLE
10 rows selected.
SQL> conn hr/hr
Connected.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
COUNTRIES TABLE
DEPARTMENTS TABLE
EMPLOYEES TABLE
EMP_DETAILS_VIEW VIEW
EMP_SAL_CHANGE TABLE
JOBS TABLE
JOB_HISTORY TABLE
LOCATIONS TABLE
REGIONS TABLE
SP_LOGERR TABLE
10 rows selected.
使用easy connect
SQL> create database link d_1 connect to scott identified by tiger using‘192.0.2.5:1521/enmo1‘;
Database link created.
SQL> select * from [email protected]_1;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
BONUS TABLE
DEPT TABLE
EMP TABLE
SALGRADE TABLE
SQL> conn scott/tiger
Connected.
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
BONUS TABLE
DEPT TABLE
EMP TABLE
SALGRADE TABLE
以上是关于oracle dblink调用SQL SERVER存储过程,有具体样例吗的主要内容,如果未能解决你的问题,请参考以下文章
Oracle DBLink跨数据库访问SQL server数据同步 踩坑实录