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!

Create DB link in a procedure

mradul goyalJul 6 2015 — edited Jul 6 2015

Hi,,

I am trying creating the DB link into a procedure

CREATE or replace PROCEDURE cre_db_lnk AS

BEGIN

    dbms_output.put_line('before exce');

  

    EXECUTE IMMEDIATE 'CREATE DATABASE LINK remote_link_3 '

            ||'CONNECT TO c1upgrade03cm IDENTIFIED BY c1upgrade03 '

            ||'USING ''sidev11g''';

          

            dbms_output.put_line('afetr exce');

END cre_db_lnk;

This procedure compiled successfully but when i check in schema browser the i can not find the DB link with this name.

And it is not even showing the DBMS_OUTPUT.

But when i tried creating using simple SQL then it got created

CREATE DATABASE LINK remote_link_2

      CONNECT TO c1upgrade03cm IDENTIFIED BY c1upgrade03

      USING 'punvm-oracle11g/sidev11g';

I am unable to figure out why it is not creating in the procedure what i am missing Here !!

My DB version is :--

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

This post has been answered by BrunoVroman on Jul 6 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 3 2015
Added on Jul 6 2015
8 comments
418 views