try removing the carriage return from the user name and password and see if
that helps

-----Original Message-----
From: Seger, Jeffrey [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 8:54 AM
To: 'David Sherrington - Enterprise Services- Data Management Systems
Engineer'; [EMAIL PROTECTED]
Subject: RE: :Oracle problem


Does the password file contain only one password?  If so, does it contain a 
newline character at the end of it?

-----Original Message-----
From: David Sherrington - Enterprise Services- Data Management Systems
Engineer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 07, 2001 6:53 AM
To: [EMAIL PROTECTED]
Subject: DBI::Oracle problem


Hello,

I've have a problem with connecting to an Oracle database using DBI under
Unix.

Basically, I have the Database user passwords in a unix flat file, which I
read 
into the perl script setting a local variable. The Oracle database name and
the 
User name a passed to the perl script as arguements.

When I try to connect to the database I get the Oracle invalid user/password

error. I have investigated this and know that the Database name and User
name 
are being picked up correctly, but for some reason the DBI module is
ignoring 
the contents of the password variable, even though it is set correctly.

Now, if I reset the password variable (ie: hard code the password into the
perl 
script) just before I try connecting to the database it works!!

If anybody has any Ideas, I would be most grateful.

Below is the code I am using:

Many thanks.

David

----------------------------------------------------------------------
#!/usr/local/bin/perl -w
##########################################
# Include DBI 
##########################################
eval '$dbh::safe = 1'       if $] >=5;
eval 'use DBI; 1' || die $@ if $] >=5;
####################################################################
#Check that three arguements have been passed and set variables
####################################################################
if (scalar(@ARGV) != 3) {
   print "ERROR: Incorrect number of arguements passed. \n";
   print "ERROR: Specify User, SID and PWD file. \n";
   exit;
}
$dbuser = $ARGV[0];
$dbname = $ARGV[1];
$pwd    = $ARGV[2];
$dbuser_orig = "$dbuser";
##################################################
# Open/retreive password from flat file
##################################################
open(USERPWD,"$pwd") || die "Could not open password file!";
$dbpass =  <USERPWD>;
close(USERPWD);
######################################################
# Connect/logon to database
######################################################
#
$dbh = DBI->connect("dbi:Oracle:$dbname","$dbuser","$dbpass", "")
      || die "$DBI::$errstr\n ";

-----------------------------------------------------------------------
 

Reply via email to