Bug found when using a stored procedure with DB2 and DBD::ODBC



Environment:
RHEL 4
perl-5.8.5-24.RHEL4
perl-DBI-1.40-8
perl-DBD-ODBC-1.13-1
unixODBC-2.2.11-3.FC4.1
iSeriesAccess-5.4.0-1.0.i386.rpm

I am trying to call a simple stored procedure on an iSeries / AS400:

#!/usr/bin/perl -w

use strict;

$ENV{PERL_DL_NONLAZY}=1;

use DBD::ODBC;

my( $dbh ) = DBI->connect('dbi:ODBC:iseries01', 'user', 'password');
my( $sth ) = $dbh->prepare( "{call CODELIB.ODBC(?, ?, ?)}");
my( $a ) = 1;
my( $b ) = 2;
my( $c ) = undef;
$sth->bind_param(1, \$a );
$sth->bind_param(2, \$b );
$sth->bind_param_inout(3, \$c, 1 );
$sth->execute();

I will always get returned:
DBD::ODBC::st execute failed: [unixODBC][IBM][iSeries Access ODBC
Driver]Error in assignment. (SQL-22018)(DBD: st_execute/SQLExecute
err=-1) at ./odbc.pl line 26.

I opened up a support request with IBM...after sending them my traces,
they have determined that there is a bug in the perl code:

"The values for Col Def & Scale in the SQLBindparameter do not match
with the parameters descriptions returned in the prepare "

Is there someone who can fix this bug so that perl will be able to
call an iSeries stored procedure ?


-Thanks
Stephen More
.



Relevant Pages

  • Re: Bug found when using a stored procedure with DB2 and DBD::ODBC
    ... I am trying to call a simple stored procedure on an iSeries / AS400: ... they have determined that there is a bug in the perl code: ... Is there someone who can fix this bug so that perl will be able to ...
    (perl.dbi.users)
  • Re: EXECUTE permission denied on nested procedure call
    ... So if this is not a bug, ... The stored procedure is prepared implicitly and actual call the ... provider calls a helper function to find the stored procedure parameter ... When the RPC escape sequence is used to execute a stored procedure, ...
    (microsoft.public.sqlserver.security)
  • Re: Bug in Visio?
    ... The bug is in Visio's use of the database stroed procedure ... A work around is to modify the stored procedure witht he following ... > known issue is the tables which are owned by objects other than the DBO ...
    (microsoft.public.sqlserver.server)
  • RE: Bug found when using a stored procedure with DB2 and DBD::ODBC
    ... I am trying to call a simple stored procedure on an iSeries / AS400: ... it is failing because the undef in the 3rd output parameter before the ... parameter is called is not set correctly when bound and the iSeries ODBC driver ...
    (perl.dbi.users)
  • Re: Bug found when using a stored procedure with DB2 and DBD::ODBC
    ... On 28-Sep-2006 Martin J. Evans wrote: ... I am trying to call a simple stored procedure on an iSeries / AS400: ...
    (perl.dbi.users)