3 Replies Latest reply: Aug 19, 2010 7:26 AM by 706888 RSS

    dbms_utility.exec_ddl_statement and database links

    792166
      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?