Home » SQL & PL/SQL » SQL & PL/SQL » dynamic creation of database links?
dynamic creation of database links? [message #39991] Mon, 02 September 2002 03:57 Go to next message
Jens Vogelgesang
Messages: 23
Registered: January 2002
Junior Member
Hi all,
I want to create a dynamic database link.
I've tried

p_create_sql := 'CREATE DATABASE LINK ' || p_database_link_name ||
' CONNECT TO ' || user_name_in ||
' IDENTIFIED BY ' || user_name_in ||
' USING ''' || instance_name_in || '''';
DBMS_OUTPUT.PUT_LINE('# ' || p_create_sql);
EXECUTE IMMEDIATE p_create_sql;

but got an error. Within a sqlplus window it works. Are there any restriction to this
Re: dynamic creation of database links? [message #39992 is a reply to message #39991] Mon, 02 September 2002 05:53 Go to previous message
Mahesh Rajendran
Messages: 10707
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
checkout the required privs!.
pl/sql cannot see the privs given via the roles.
so, grant the prives ( create db link etc...) explicitly to the user( using grant privlege command).
and try again.
Previous Topic: Ora Date format
Next Topic: query optimisation
Goto Forum:
  


Current Time: Thu Apr 18 22:03:37 CDT 2024