ZF-5146: Add simpler CLOB support to fetch()
Description
hi,
fetch() lack the support of OCI_RETURN_LOBS (oci_fetch_array)
this is strange because oci_fetch_all (and so ->fetchAll() ) returns CLOB...
her is the way it could be :
public function fetch($style = null, $cursor = null, $offset = null)
{
if (!$this->_stmt) {
return false;
}
if ($style === null) {
$style = $this->_fetchMode;
}
switch ($style) {
case Zend_Db::FETCH_NUM:
$row = oci_fetch_array($this->_stmt, OCI_NUM|OCI_RETURN_LOBS);
break;
case Zend_Db::FETCH_ASSOC:
$row = oci_fetch_array($this->_stmt, OCI_ASSOC|OCI_RETURN_LOBS);
break;
case Zend_Db::FETCH_BOTH:
$row = oci_fetch_array($this->_stmt, OCI_BOTH|OCI_RETURN_LOBS);
break;
case Zend_Db::FETCH_OBJ:
$row = oci_fetch_object($this->_stmt);
break;
case Zend_Db::FETCH_BOUND:
$row = oci_fetch_array($this->_stmt, OCI_BOTH|OCI_RETURN_LOBS);
if ($row !== false) {
return $this->_fetchBound($row);
}
break;
default:
/**
* @see Zend_Db_Adapter_Oracle_Exception
*/
require_once 'Zend/Db/Statement/Oracle/Exception.php';
throw new Zend_Db_Statement_Oracle_Exception(
array(
'code' => 'HYC00',
'message' => "Invalid fetch mode '$style' specified"
)
);
break;
}
...
maybe OCI_RETURN_LOBS should be controlled by a driver option....
Comments
Posted by Mickael Perraud (mikaelkael) on 2008-12-06T08:36:42.000+0000
Fixed in SVN13073. Need to document the new driver option.
Posted by Mickael Perraud (mikaelkael) on 2008-12-15T13:47:30.000+0000
Merged to 1.7-branch