Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Multiple database connections with AT clause
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
![]() |
![]() |