1
我使用的是Oracle適配器進行連接到數據庫連接到數據庫,這裏的中的application.ini的配置,錯誤,同時試圖使用Zend Framework
resources.db.adapter = "Oracle"
resources.db.params.host = "localhost"
resources.db.params.username = "user"
resources.db.params.password = "2012"
resources.db.params.dbname = "books"
resources.db.isDefaultTableAdapter = true
在這裏我如何調用存儲過程
$db = Zend_Db_Table::getDefaultAdapter();
try {
// $sql = "select * from dual";
$sql = "begin BA_OPERATIONS_PKG.GETMEMBERCRED(" .
":I_USER_ID, :DATA_REC); end;";
$statement = new Zend_Db_Statement_Oracle($db, $sql);
$params = array(
'I_USER_ID' => $userId
);
// Create a cursor
$cursor = new Zend_Db_Cursor_Oracle($db);
// Bind the cursor as a parameter. This SHOULD push a new cursor in the
// $_bindCursor stack from Zend_Db_Statement.
$statement->bindCursor('DATA_REC', $cursor);
$statement->execute($params);
echo $cursor;
} catch (Exception $e) {
print_r($e->getMessage());
}
這裏的例外,我有
include_once(Zend\Db\Cursor\Oracle.php) [function.include-once]: failed to open stream: No such file or directory in D:\ZendFramework\library\Zend\Loader.php
Zend Framework中沒有'Zend_Db_Cursor_Oracle'類。我能找到的唯一參考是2009年的這個提案:http://framework.zend.com/wiki/display/ZFPROP/Zend_Db_Cursor+-+Bruno+Piraja+Moyle,但該組件從未將其納入ZF。 –
這是我從中獲取資源的網站。 – palAlaa
你有沒有更好的方法來從orcale接收遊標? – palAlaa