Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

dbms_utility.exec_ddl_statement and database links

792166Aug 19 2010 — edited Aug 19 2010
I want create database objects to remote databases using database links and dbms_utility.exec_ddl_statement. How I can refer database links dynamically in oracle stored procedures? It is easy to do in Oracle SQL*plus using SQL:

Example code (SQL script);

SET VERIFY OFF
SET PAGES 0
SET FEEDBACK OFF
SPOOL C:\TMP\REMOTE_TEST.txt

DEFINE MyVar='@MYLINK.WORLD';

EXEC dbms_utility.exec_ddl_statement&MyVar('CREATE TABLE REMOTETEST (COL1 varchar2(20))');

SPOOL OFF
SET VERIFY ON
SET FEEDBACK ON


What about PLSQL and stored procedure?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 16 2010
Added on Aug 19 2010
3 comments
2,447 views