Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Multiple database connections with AT clause

Multiple database connections with AT clause

From: Joerg Heinrich <JHeinrich_at_heyde_DESPAM.de>
Date: Thu, 14 Feb 2002 18:27:17 +0100
Message-ID: <3C6BF375.35C48955@heyde_DESPAM.de>


Hello,

I'm working on an application using the Pro*C/C++ precompiler. This app has to establish multiple connections to the same database, which I can do using the follwing statement repeatedly with different values in user, pwd and conn :

EXEC SQL CONNECT :user IDENTIFIED BY :pwd AT :conn USING :dbname;

I know that I have to use the AT clause in following SQL statements to identify the connection to use, like in:

EXEC SQL AT :conn SELECT ....

This works fine and I'm happy with that. But unfortunately there are a few statements which do not allow an AT clause! For example allocating a descriptor for dynamic SQL method 4:

EXEC SQL allocate descriptor :descin with max 256;

When I add an AT clause, the precompiler gives the error message "PCC-02386 Use of the AT clause is not permitted here". When I leave it away, I get a runtime error "ORA-01012 not logged on".

Does anybody know what I'm doing wrong? Do I have to establish an additional default (unnamed) connection just for the descriptor allocation? Will this work together with the following SQL statements on a named connection, using the descriptor from the unnamed one?

Any help will be greatly appreciated!

Best wishes,
Joerg

P.S.: Remove the _DESPAM from my mail address to answer to me directly. Received on Thu Feb 14 2002 - 11:27:17 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US