有朋友在留言板問:如何通過動態sql遠程調用包裡面的函數
我簡單做了一個例子
首先進行適當授權
[oracle@jumper oracle]$ sqlplus/ as sysdba SQL*Plus: Release
Production on Tue Nov : : Copyright (c)
Oracle Corporation All rights reserved Connected to:
Oraclei Enterprise Edition Release Production
With the Partitioning option
JServer ReleaseProduction SQL> grant create public database link to eygle;
Grant succeeded
SQL> grant all on dbms_flashback to eygle;Grant succeeded
建立DB Link:
SQL> connect eygle/eygle
Connected
SQL> create public database link hsbill usinghsbill ; Database link created
SQL> select db_link from dba_db_links;
DB_LINK
HSBILLSQL> select * from dual@hsbill;
D
X
此後可以嘗試使用DB Link進行遠程和本地執行:
SQL> set serveroutput on
SQL> set feedback off
SQL> declare
gname of remote:HSBILL
gname of locald:EYGLE
遠程Package或Function調用也可以隨之實現:
SQL> declare
scn of remote:
SQL>
From:http://tw.wingwit.com/Article/program/Oracle/201311/17874.html