|Subject:||[1.28] Major problem with ORA_VARCHAR2 inout parameters on Oracle 11|
|Date:||Fri, 13 May 2011 13:52:04 +0200|
|To:||bug-DBD-Oracle [...] rt.cpan.org|
|From:||Tim Van Holder <tim.vanholder [...] anubex.com>|
Problem seen in: - 64-bit DBD::Oracle 1.27 as supplied by ActiveState PPM - 32-bit DBD::Oracle 1.27 as supplied by ActiveState PPM - 32-bit DBD::Oracle 1.28 as built via the CPAN module on ActiveState Perl Code has: my $sth = $dbh->prepare("BEGIN :filename := mypackage.myfunc; END;"); return unless $sth; my $filename; $sth->bind_param_inout(':filename', \$filename, 4000, ORA_VARCHAR2) or return; $sth->execute() or return; $filename =~ s/\s+$// if defined $filename; # strip trailing spaces return $filename; This code triggers no warnings or errors whatsoever, but $filename ends up completely blank. Use of dbms_output shows that a value is returned properly by the package functions - it is the binding itself that seemed to be (silently) failing. Using SQL_VARCHAR instead of ORA_VARCHAR2 works, so we have a viable workaround, but it is not exactly nice to have behaviour silently failing like this. ORA_NUMBER inout parameters do work as expected. I'm currently assuming this to be an Oracle 11 issue; I have not yet been able to test the behaviour on a non-Windows platform with Oracle 11 client, so it _may_ be Windows-specific too.