Re: Help SQL*Net V2 and Pro*C
Date: 1996/06/21
Message-ID: <1996Jun21.151312.18659_at_tijc02.uucp>#1/1
From article <darrell_coons-1906961224290001_at_dcoons2.roch875.mc.xerox.com>, by darrell_coons_at_mc.xerox.com (Darrell Coons):
> I'm having a problem using a Pro*C 2.2 program to connect to a remote
> database (Oracle 7.3.2) using SQL*Net V2. I can successfully connect to a
> local db using the following:
>
> EXEC SQL CONNECT :oracle_user IDENTIFIED BY :oracle_pword;
>
> But when I try to connect to the remote db using the following:
>
> EXEC SQL DECLARE mydb DATABASE:
> EXEC SQL CONNECT :oracle_user IDENTIFIED BY :oracle_pword AT mydb USING
> :oracle_tns;
>
I use
EXEC SQL CONNECT :uname IDENTIFIED BY :pword USING :db_string;
where uname = user id
pword = password db_string = database ID (like "orac")
and it works fine. Just make sure that the database ID is correctly identified in your tnsnames.ora file. On my platform (SCO UNIX) I also make sure that the string case matches.
-- Alan Watson Siemens Industrial Automation, Inc waw103%tijc02_at_uunet.uu.net Johnson City, Tennessee, USA uunet!tijc02!waw103Received on Fri Jun 21 1996 - 00:00:00 CEST