Re: Explicit Connections in Pro*C
Date: 1996/05/13
Message-ID: <31974361.30C6_at_sectra.se>#1/1
Will Jones wrote:
>
> We have a C program with embedded SQL developed with Pro*C. We
> also have multiple instances of Oracle on our server. If the user has
> his ORACLE_SID environmental variable set to the correct instance, the
> program connects and works fine. If not, he gets an "Oracle not
> available" message and no connection.
>
> Our current connect statement is like:
>
> EXEC SQL CONNECT :username IDENTIFIED BY :password;
>
> where the user is prompted for the Oracle logon ID and password. Can the
> instance of Oracle be specified here as well?
>
> --
> Bill Jones e-mail addresses:
> Computer Sciences Corp. (work) wjones14_at_csc.com
> Norwich, Connecticut (play) billj_at_mindport.net
> (203) 823-2168
You could use
EXEC SQL CONNECT :connect_str
where connect_str has the form <user>/<password>_at_<database>
-- Almut Herzog SECTRA Secure Transmission AB e-mail: al-her_at_sectra.se Teknikringen 2 voice: ++46 13 235221 583 30 Linkoping fax: ++46 13 212185 SWEDENReceived on Mon May 13 1996 - 00:00:00 CEST