I recently start playing with stored procedures for db2(one day ago) and I manage to create very simple SP that worked fine when I tested them in the iAccess Navigator. Now Im trying to call the SP from my model but Im getting errors back and Im not sure how to get the return variable. Here is some code
here is my SP
drop procedure schema.test_ac ;
CREATE PROCEDURE schema.test_ac (IN a int, in b int, out c int)
LANGUAGE SQL
BEGIN
set c=b+a;
END;
here is the php code
public function storePro(){
$queryStr = "call test_ac (1,1,?)";
$stmt = $this->db->query($queryStr);
print_r($stmt->fetchAll());
}
any help will be nice Thank you
Zend_Db may have an issue when handling DB2 stored procedures. I’ll try to get that fixed in ZF 2.0. However, today you can run your example successfully using the base ibm_db2 driver functions. I tested this on a v7.1 IBM i system: