我有以下oracle程序:
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;
现在我尝试使用zend framework 1中的zend-db获取一个客户数组,但我不能,这是我的尝试:
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);
我使它工作,我不得不在我的zend库中添加更多新文件,我的问题是有另一种使用输出参数调用存储过程的方法,它是由zend framework 1库引用的游标吗?
此致