Re: Connect Pl SQL

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 05 Jul 1999 19:11:45 GMT
Message-ID: <378c0313.11681216_at_newshost.us.oracle.com>


A copy of this was sent to Paolo Cassago <paoloc_at_zeropiu.it> [Quoted] (if that email address didn't require changing) On Mon, 05 Jul 1999 19:00:20 +0200, you wrote:

>
>Hi,
>I' m trying to establish a connection from a stored procedure and I'm
>using the follow instruction:
>

chicken and egg problem. You are in a stored procedure -- this implies you are ALREADY logged in. You don't need to log in again. If you need to access data at some other database, you use database links to do that.

There is no syntax to connect from PLSQL. Client environments, such as forms and reports, that run plsql on the client, allow you to connect to a database using a specific (to them) API call. a stored procedure cannot 'log in'.

>is
> cid INTEGER;
>begin
> cid := DBMS_SQL.OPEN_CURSOR;
> DBMS_SQL.PARSE(cid, 'CONNECT user/passwd_at_serveroracle',
>dbms_sql.v7);
>
>
>But the follow errors occurs:
>
>ORA-00900: invalid SQL statement
>ORA-06512: at "SYS.DBMS_SYS_SQL", line 491
>ORA-06512: at "SYS.DBMS_SQL", line 32
>ORA-06512: at "PAOLO.PROVAUT", line 5
>ORA-06512: at line 2
>
>Can someone help me?? Thank you. Bye
>
>

-- 
See http://govt.us.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
[Quoted] Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Mon Jul 05 1999 - 21:11:45 CEST

Original text of this message