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!

how to connect to another user from a named pl/sql block.

Tarek FathySep 6 2005 — edited Sep 7 2005
dear friends
i really need to connect to another database from a function.
i created this function which receive a username and a password to connect to a schema

create or replace function f_conn(Puser varchar2,Ppassword varchar2)
return boolean
is
vConnString varchar2(10);
begin
select name
into vConnString
from sys.v_$database;
if Puser is not null and Ppassword is not null then
conn puser||'/'||ppassword||'@'||vConnString --<< the error ocuure here
end if;
return true;
exception
when others then
return false;
end;

the follwing error occures :
ORA-06550
PLS-00103

in brief , all i need is how to connect to another user from a named pl/sql block.
Is this possible ??
Please I need an answer
thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 5 2005
Added on Sep 6 2005
3 comments
6,307 views