elf_firein has asked for the wisdom of the Perl Monks concerning the following question:
I have faced a major problem with DBI package when I am using perl5.8.4 in solaris 10 box.
use strict; use DBI; use Carp; sub DB_xxx { my ($dbUser, $dbPass, $db, $autoCommit) = @_; my $dbh; # logon to DB unless( $dbh = DBI->connect('dbi:Oracle:' . ($$db || ''), $$dbUser +, $$dbPass, {AutoCommit => $$autoCommit}) ) { croak "Error connecting to database $DBI::errstr \n"; } return $dbh; } my $user = "xxxx"; my $pass = "xxxx"; my $db ; my $autocommit = 0; my $dbh = DB_xxx(\$user, \$pass, \$db, \$autocommit); #problem starts here #if we so any unix command call or closing an file/pipe #handle after +that such as using system() or backtricks it #returns -1 in $! & $? c +onatins "no child process" #example `gzip -cd filename`; # or system("gzip -cd filename"); #or open ($fh, "gzip -cd filename|"); #or close ($fh); print "$?:$!\n";
after a dbi subroutine call any system call as example given above returning the message "no child process for $? & $! conatins "-1" as status. But if we pass value for variable $db in code such as:
my $user = "xxx"; my $pass = "xxx"; my $db = "abcd"; #that is valid hostname for oracle.
the program is running wirhout throwing any warning or $! as 0. I need to implement similar way by which sqlplus utility connect to database in local box only with user/password.
what I want through DBI is:
sqlplus xxx/xxx
what i don't want through DBI is
sqlplus xxx/xxx@abcd
Is it an existing bug in DBI? Is there any solution for this problem.
I have updated the text of message
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: The bug in DBI package
by ikegami (Patriarch) on Apr 15, 2009 at 05:36 UTC | |
by elf_firein (Acolyte) on Apr 15, 2009 at 06:26 UTC | |
by ikegami (Patriarch) on Apr 15, 2009 at 06:38 UTC | |
by elf_firein (Acolyte) on Apr 15, 2009 at 07:04 UTC | |
Re: The bug in DBI package
by cdarke (Prior) on Apr 15, 2009 at 08:30 UTC | |
by mje (Curate) on Apr 23, 2009 at 11:08 UTC | |
by elf_firein (Acolyte) on Apr 15, 2009 at 10:14 UTC | |
by cdarke (Prior) on Apr 15, 2009 at 14:37 UTC | |
Re: The bug in DBI package
by ig (Vicar) on Apr 15, 2009 at 07:01 UTC | |
by elf_firein (Acolyte) on Apr 15, 2009 at 08:17 UTC | |
by ig (Vicar) on Apr 16, 2009 at 01:12 UTC | |
Re: The bug in DBI package
by Anonymous Monk on Apr 15, 2009 at 05:08 UTC |
Back to
Seekers of Perl Wisdom