Subject: | Bind output parameter CHAR(1), but it returns multiple characters |
Binding output one-character parameter (type=ORA_CHAR size=1) does not work correctly.
$sth->bind_param_inout(':out', \my $result, 1, {ora_type => ORA_CHAR});
See attached test file.
It returns wrong output on DBD::Oracle=1.70 -- see output:
perl=5.018002 DBI=1.631 DBD::Oracle=1.70
$VAR1 = '1 ';
But it works currectly on version 1.68 -- see output:
perl=5.018002 DBI=1.631 DBD::Oracle=1.68
$VAR1 = '1';
Subject: | dbd-oracle-error.pl |
#!/usr/bin/env perl
use strict;
use warnings;
use DBI;
use DBD::Oracle qw(:ora_types);
use Data::Dumper;
print "perl=$] DBI=$DBI::VERSION DBD::Oracle=$DBD::Oracle::VERSION\n";
my $dbh = DBI->connect(
"dbi:Oracle:$ENV{ORA_DBNAME}",
$ENV{ORA_USER},
$ENV{ORA_PASSWORD},
{RaiseError => 1}
);
my $sth = $dbh->prepare(qq{
BEGIN
:out := '1';
END;
});
$sth->bind_param_inout(':out', \my $result, 1, {ora_type => ORA_CHAR});
$sth->execute();
print Dumper($result);
$dbh->disconnect;