-1

I have the following oracle procedure:

TYPE VarRecCur IS RECORD (
     CustomerId     Customer.CustomerId%TYPE,
     Name           Customer.Name%TYPE
     );

TYPE VarCursor_CUSTOMER IS REF CURSOR RETURN VarRecCur;

PROCEDURE PROC_Customer(pCustomerId IN VARCHAR2,RECOUTPUT IN OUT VARCURSOR_CUSTOMER)
IS
BEGIN
   OPEN RECOUTPUT FOR
   SELECT CustomerId, Name FROM Customer
   WHERE CustomerId =  pCustomerId
END PROC_Customer;

Now I tried to get an customer array using zend-db from zend framework 1, but I couldn't, that was my try:

require_once 'Zend/Db/Statement/Oracle.php';

$db = Zend_Db::factory ( 'pdo_oci', array ('dbname' => DB_SERVER,'username' => 'user','password' => 'pass') );
$stmt = new Zend_Db_Statement_Oracle($db, "begin PROC_Customer('1',:cursor); end;");
$cursor = new Zend_Db_Cursor_Oracle($db);
$stmt->bindCursor('cursor', $cursor);
$stmt->execute();
var_dump($cursor);

I made it works, I had to add more new files to my zend library, my question is there another way to call stored procedure using output parameter which is ref cursor by zend framework 1 library?

Regards

doydoy44
  • 5,720
  • 4
  • 29
  • 45
user3637971
  • 313
  • 5
  • 21

1 Answers1

0

I wrote this answer to another question, maybe it will help you.
It was for MySql, so I have not tested but I used pdo like you.

Community
  • 1
  • 1
doydoy44
  • 5,720
  • 4
  • 29
  • 45