This is the bug which I have posted in forum
http://www.nntp.perl.org/group/perl.dbi.users/2007/05/msg31388.html
Test Code:
----------
#!/usr/bin/perl
use DBI;
use Data::Dumper;
#DBI->trace(5);
my $dbh = DBI->connect("DBI:Oracle:orcl",'scott','tiger')
or die "Can't connect to : $DBI::errstr";
$dbh->{RaiseError} = 1;
my $sth = $dbh->prepare( q{select ename from emp where empno = ?})
or die "Can't prepare statement: $DBI::errstr";
@bind = (7902);
my $rc = $sth->execute(@bind) or die "Can't execute statement:
$DBI::errstr";
while ( $row = $sth->fetchrow_arrayref() ) {
print Dumper $row;
}
my @bind1 = ();
my $rc = $sth->execute(@bind1) or die "Can't execute statement:
$DBI::errstr";
while ( $row = $sth->fetchrow_arrayref() ) {
print Dumper $row;
}
Result
------
$VAR1 = [
'FORD'
];
$VAR1 = [
'FORD'
];
If you observe closely you can see that the first the records were
retrieved when the bind value was provided. During the second run there
was no bind value but still it returns the old result, which i feel
shouldn't be the behavior. It should try to error out.