db2_bind_param not working

Re: db2_bind_param not working

Postby mlavinder on Wed Jul 21, 2010 2:20 pm

I have been working with a Zend contact (Sam Pinkhasov) on this issue for a few weeks now. I received an email this morning confirming that there is a problem in the ibm_db2 extension under PHP 5.3. Zend is contacting IBM about the issue. This is not a situation where every stored procedure fails under ibm_db2 and PHP 5.3. If you run up against this "Value Not Bound" message and suspect you've ran into this issue, modify your code and call the procedure using the i5 Toolkit. If it works there but not when using db2 calls, then you've ran into this issue.

I have to give credit to Zend for this one because they didn't give up and sweep this under a rug. Sam kept communicating with me even when initial attempts to replicate the issue weren't successful on their end.
mlavinder
 
Posts: 77
Joined: Fri Apr 10, 2009 3:12 pm

Re: db2_bind_param not working

Postby bucknum on Wed Aug 11, 2010 6:33 pm

Thanks mlavinder. We just moved to Zend Server last week and have been pulling our hair out over this issue. I've moved back to Zend Server 5.0.2 with PHP 5.2 and everything is working fine. Please let us know when IBM and Zend have worked out a solution for the issue.
bucknum
 
Posts: 10
Joined: Wed Aug 11, 2010 6:32 pm

Re: db2_bind_param not working

Postby mlavinder on Wed Aug 11, 2010 9:05 pm

bucknum wrote:Thanks mlavinder. We just moved to Zend Server last week and have been pulling our hair out over this issue. I've moved back to Zend Server 5.0.2 with PHP 5.2 and everything is working fine. Please let us know when IBM and Zend have worked out a solution for the issue.


I actually have a version of the ibm_db2 extension that they patched and sent to me. It fixes the issue. Unfortunately, they created the fix just a few days before the new Zend Server came out. It didn't make it into the latest release. If you PM me your address I can send it to you.
mlavinder
 
Posts: 77
Joined: Fri Apr 10, 2009 3:12 pm

Re: db2_bind_param not working

Postby vkolahur on Fri Sep 10, 2010 4:03 pm

mlavinder wrote:
bucknum wrote:Thanks mlavinder. We just moved to Zend Server last week and have been pulling our hair out over this issue. I've moved back to Zend Server 5.0.2 with PHP 5.2 and everything is working fine. Please let us know when IBM and Zend have worked out a solution for the issue.


I actually have a version of the ibm_db2 extension that they patched and sent to me. It fixes the issue. Unfortunately, they created the fix just a few days before the new Zend Server came out. It didn't make it into the latest release. If you PM me your address I can send it to you.


Hi,

Can you send me the patch too. We are having lot of issues with the stored procedures calls. All of it is working well under Zend Core. My email id is vini.kolathur@dhl.com .

Regards,
Vini
vkolahur
 
Posts: 2
Joined: Fri Sep 10, 2010 3:56 pm

Re: db2_bind_param not working

Postby zend_i5 on Thu Sep 16, 2010 9:23 am

The IBM_DB2 extension is fixed in Zend Server 5.0.2. Use Zend Server 5.0.2 installation or Zend Server 5.0.2 PTF in order to get latest Zend Server modules (including IBM_DB2).
zend_i5
 
Posts: 140
Joined: Mon Mar 23, 2009 5:22 pm

Re: db2_bind_param not working

Postby benh55 on Fri Nov 19, 2010 4:33 pm

I am still getting an error message. Strange.
benh55
 
Posts: 4
Joined: Fri Nov 19, 2010 4:18 pm

Re: db2_bind_param not working

Postby davelhs03 on Wed Feb 08, 2012 11:33 pm

Anyone else still getting this issue?

I'm trying to upgrade from Zend Core 2.6.0 to Zend Server for I 5.6 and I'm running into problems with db2_* functions and calling a rpg stored procedure with 3 IN parameters and 1 INOUT parameter. I'm starting to think I'll have to use the toolkit functions. I'd rather not use the toolkit...

Thanks,

Dave
davelhs03
 
Posts: 38
Joined: Mon Mar 30, 2009 6:20 pm

Re: db2_bind_param not working

Postby davelhs03 on Thu Feb 09, 2012 5:29 pm

I figured out my problem. I was missing the library list option (i5_libl) on db2_connect. After adding the library list my stored procedure appears to be working.

Code: Select all
$options = array('autocommit' => 'DB2_AUTOCOMMIT_OFF',
                 'i5_lib' => 'DEFAULTLIB',
                 'i5_libl' => 'ARLIB1 APLIB2 ACLIB3');
$db = db2_connect( $config['dbname'], $config['username'] , $config['password'],$options);

$account = "";
$date = "";
$balance = "";
$dataout = "";

$statement = db2_prepare($db, "CALL DEFAULTLIB.APE001D(?,?,?,?)");

db2_bind_param($statement, 1, "account", DB2_PARAM_IN);
db2_bind_param($statement, 2, "date", DB2_PARAM_IN);
db2_bind_param($statement, 3, "balance", DB2_PARAM_IN);
db2_bind_param($statement, 4, "dataout", DB2_PARAM_INOUT);

print "Values of bound parameters _before_ CALL:\n";
print "  1: {$account} 2: {$date} 3: {$balance} 4: {$dataout}\n\n";

if (db2_execute($statement))
{
   print "Values of bound parameters _after_ CALL:\n";
   print "  1: {$account} 2: {$date} 3: {$balance} 4: {$dataout}\n\n";

   print "Results:\n";
   while ($row = db2_fetch_array($stmt))
   {
      print "  {$row[0]}, {$row[1]}, {$row[2]}, {$row[3]}\n";
   }
}
exit();

davelhs03
 
Posts: 38
Joined: Mon Mar 30, 2009 6:20 pm

Previous

Return to Zend Server for IBM i

Who is online

Users browsing this forum: No registered users and 2 guests