Article 19201 of comp.lang.perl:
Xref: ig.co.uk comp.databases.oracle:15849 comp.lang.perl:19201
Newsgroups: comp.databases.oracle,comp.lang.perl
Path: ig.co.uk!demon!uknet!lyra.csx.cam.ac.uk!doc.ic.ac.uk!agate!darkstar.UCSC.EDU!news.hal.COM!olivea!decwrl!pa.dec.com!srs.gov!deborah.henkel
From: deborah.henkel@srs.gov (Deborah J. Henkel)
Message-ID: <9408251932.AA11284@slsand.srs.gov.srs.gov>
Subject: RE: oraperl SQL*Net V2 connect string
Date: Thu, 25 Aug 94 15:35:40 EST
X-Received: by usenet.pa.dec.com; id AA04018; Thu, 25 Aug 94 12:52:43 -0700
X-Received: by pobox1.pa.dec.com; id AA29515; Thu, 25 Aug 94 12:52:23 -0700
X-Received: from bubba.srs.gov by inet-gw-3.pa.dec.com (5.65/10Aug94)
	id AA04503; Thu, 25 Aug 94 12:32:19 -0700
X-Received: by srs.gov id AA59667
  (InterLock SMTP Gateway 1.1); Thu, 25 Aug 1994 15:29:39 -0400
X-Received: by srs.gov (Internal Mail Agent-1);
  Thu, 25 Aug 1994 15:29:39 -0400
X-To: comp.databases.oracle.usenet@decwrl.dec.com,
        comp.lang.perl.usenet@decwrl.dec.com
X-Mailer: LeeMail 1.2.4
Lines: 59

Here is the solution to my problem from Kevin Stock.  It works great now.
Hopefully this will help anyone out there who also may be having this
problem.

| I am having problems using the SQL*Net V2 connect string in my oraperl
| programs.  The SQL*Net V1 string works just fine.
| 
| I am going between two SUN Sparcstations running SUN OS 4.1.3.  I have 
| verified that the SQL*Net V2 is set up correctly since I created a 
| database link using the V2 connect descriptor and within SQL Plus I am
| able to communicate between the two databases.  However, using oraperl
| I am unsuccessful.
| 
| 
| For SQL*Net V1 I have:
| $lda = &ora_login("T:slsand:SID7","oracle_user_name","oracle_password");
| This works fine
| 
| 
| For SQL*Net V2 I have:
| $lda = &ora_login("SLSAND","oracle_user_name","oracle_password");
| This does not work fine

Here is the solution:

This may be a problem of Oraperl trying to be too clever for its own
good. If the first argument to &ora_login() contains a colon, it is
assigned to the variable TWO_TASK; if not, it is assigned to ORACLE_SID.
As your v2 net descriptor doesn't contain a colon, Oraperl puts it in
ORACLE_SID and Oracle thinks it's meant to be a local database.

The easiest workaround is probably something like this:

        undef $ENV{'ORACLE_SID'};
        $ENV{'TWO_TASK'} = 'SLSAND';
        $lda = &ora_login('', 'user', 'pass');

The empty first argument will make Oraperl use the existing environment
instead of creating its own.

There isn't likely to be a fix for this as I don't have access to a
system running Oracle any more. In fact, I've only just got back to the
net after a year unemployed, and I'm not likely to spend a lot of time
on News, at least for the moment.

        Kevin
        kstock@auspex.fr


--------------------------------------
Deborah Henkel
Westinghouse Savannah River Laboratory
Building 773-42A
Aiken, SC 29808
                                  
phone: (803) 725-8199           
email: deborah.henkel@srs.gov 
--------------------------------------     



