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
In reply to The bug in DBI package by elf_firein
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |