mirror of
https://github.com/ACSPRI/queXS
synced 2024-04-02 12:12:16 +00:00
Merged from McMasterReports branch
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
version V4.94 23 Jan 2007 (c) 2000-2007 John Lim. All rights reserved.
|
||||
version V5.06 16 Oct 2008 (c) 2000-2009 John Lim. All rights reserved.
|
||||
|
||||
Released under both BSD license and Lesser GPL library license.
|
||||
Whenever there is any discrepancy between the two licenses,
|
||||
@@ -81,13 +81,13 @@ class ADODB_oci8 extends ADOConnection {
|
||||
var $leftOuter = ''; // oracle wierdness, $col = $value (+) for LEFT OUTER, $col (+)= $value for RIGHT OUTER
|
||||
var $session_sharing_force_blob = false; // alter session on updateblob if set to true
|
||||
var $firstrows = true; // enable first rows optimization on SelectLimit()
|
||||
var $selectOffsetAlg1 = 100; // when to use 1st algorithm of selectlimit.
|
||||
var $selectOffsetAlg1 = 1000; // when to use 1st algorithm of selectlimit.
|
||||
var $NLS_DATE_FORMAT = 'YYYY-MM-DD'; // To include time, use 'RRRR-MM-DD HH24:MI:SS'
|
||||
var $dateformat = 'YYYY-MM-DD'; // for DBDate()
|
||||
var $dateformat = 'YYYY-MM-DD'; // DBDate format
|
||||
var $useDBDateFormatForTextInput=false;
|
||||
var $datetime = false; // MetaType('DATE') returns 'D' (datetime==false) or 'T' (datetime == true)
|
||||
var $_refLOBs = array();
|
||||
|
||||
|
||||
// var $ansiOuter = true; // if oracle9
|
||||
|
||||
function ADODB_oci8()
|
||||
@@ -96,8 +96,8 @@ class ADODB_oci8 extends ADOConnection {
|
||||
if (defined('ADODB_EXTENSION')) $this->rsPrefix .= 'ext_';
|
||||
}
|
||||
|
||||
/* Function &MetaColumns($table) added by smondino@users.sourceforge.net*/
|
||||
function &MetaColumns($table)
|
||||
/* function MetaColumns($table) added by smondino@users.sourceforge.net*/
|
||||
function MetaColumns($table)
|
||||
{
|
||||
global $ADODB_FETCH_MODE;
|
||||
|
||||
@@ -141,7 +141,7 @@ class ADODB_oci8 extends ADOConnection {
|
||||
|
||||
function Time()
|
||||
{
|
||||
$rs =& $this->Execute("select TO_CHAR($this->sysTimeStamp,'YYYY-MM-DD HH24:MI:SS') from dual");
|
||||
$rs = $this->Execute("select TO_CHAR($this->sysTimeStamp,'YYYY-MM-DD HH24:MI:SS') from dual");
|
||||
if ($rs && !$rs->EOF) return $this->UnixTimeStamp(reset($rs->fields));
|
||||
|
||||
return false;
|
||||
@@ -184,7 +184,7 @@ NATSOFT.DOMAIN =
|
||||
function _connect($argHostname, $argUsername, $argPassword, $argDatabasename,$mode=0)
|
||||
{
|
||||
if (!function_exists('OCIPLogon')) return null;
|
||||
|
||||
#adodb_backtrace();
|
||||
|
||||
$this->_errorMsg = false;
|
||||
$this->_errorCode = false;
|
||||
@@ -200,6 +200,11 @@ NATSOFT.DOMAIN =
|
||||
$argHostport = empty($this->port)? "1521" : $this->port;
|
||||
}
|
||||
|
||||
if (strncasecmp($argDatabasename,'SID=',4) == 0) {
|
||||
$argDatabasename = substr($argDatabasename,4);
|
||||
$this->connectSID = true;
|
||||
}
|
||||
|
||||
if ($this->connectSID) {
|
||||
$argDatabasename="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=".$argHostname
|
||||
.")(PORT=$argHostport))(CONNECT_DATA=(SID=$argDatabasename)))";
|
||||
@@ -272,10 +277,10 @@ NATSOFT.DOMAIN =
|
||||
}
|
||||
|
||||
// format and return date string in database date format
|
||||
function DBDate($d)
|
||||
function DBDate($d,$isfld=false)
|
||||
{
|
||||
if (empty($d) && $d !== 0) return 'null';
|
||||
|
||||
if ($isfld) return 'TO_DATE('.$d.",'".$this->dateformat."')";
|
||||
if (is_string($d)) $d = ADORecordSet::UnixDate($d);
|
||||
return "TO_DATE(".adodb_date($this->fmtDate,$d).",'".$this->dateformat."')";
|
||||
}
|
||||
@@ -297,9 +302,10 @@ NATSOFT.DOMAIN =
|
||||
}
|
||||
|
||||
// format and return date string in database timestamp format
|
||||
function DBTimeStamp($ts)
|
||||
function DBTimeStamp($ts,$isfld=false)
|
||||
{
|
||||
if (empty($ts) && $ts !== 0) return 'null';
|
||||
if ($isfld) return 'TO_DATE(substr('.$ts.",1,19),'RRRR-MM-DD, HH24:MI:SS')";
|
||||
if (is_string($ts)) $ts = ADORecordSet::UnixTimeStamp($ts);
|
||||
return 'TO_DATE('.adodb_date("'Y-m-d H:i:s'",$ts).",'RRRR-MM-DD, HH24:MI:SS')";
|
||||
}
|
||||
@@ -310,14 +316,14 @@ NATSOFT.DOMAIN =
|
||||
return $this->GetOne("select $flds from $tables where $where for update");
|
||||
}
|
||||
|
||||
function &MetaTables($ttype=false,$showSchema=false,$mask=false)
|
||||
function MetaTables($ttype=false,$showSchema=false,$mask=false)
|
||||
{
|
||||
if ($mask) {
|
||||
$save = $this->metaTablesSQL;
|
||||
$mask = $this->qstr(strtoupper($mask));
|
||||
$this->metaTablesSQL .= " AND upper(table_name) like $mask";
|
||||
}
|
||||
$ret =& ADOConnection::MetaTables($ttype,$showSchema);
|
||||
$ret = ADOConnection::MetaTables($ttype,$showSchema);
|
||||
|
||||
if ($mask) {
|
||||
$this->metaTablesSQL = $save;
|
||||
@@ -326,7 +332,7 @@ NATSOFT.DOMAIN =
|
||||
}
|
||||
|
||||
// Mark Newnham
|
||||
function &MetaIndexes ($table, $primary = FALSE, $owner=false)
|
||||
function MetaIndexes ($table, $primary = FALSE, $owner=false)
|
||||
{
|
||||
// save old fetch mode
|
||||
global $ADODB_FETCH_MODE;
|
||||
@@ -399,8 +405,10 @@ NATSOFT.DOMAIN =
|
||||
$this->autoCommit = false;
|
||||
$this->_commit = OCI_DEFAULT;
|
||||
|
||||
if ($this->_transmode) $this->Execute("SET TRANSACTION ".$this->_transmode);
|
||||
return true;
|
||||
if ($this->_transmode) $ok = $this->Execute("SET TRANSACTION ".$this->_transmode);
|
||||
else $ok = true;
|
||||
|
||||
return $ok ? true : false;
|
||||
}
|
||||
|
||||
function CommitTrans($ok=true)
|
||||
@@ -541,6 +549,12 @@ NATSOFT.DOMAIN =
|
||||
return $s. "')";
|
||||
}
|
||||
|
||||
function GetRandRow($sql, $arr = false)
|
||||
{
|
||||
$sql = "SELECT * FROM ($sql ORDER BY dbms_random.value) WHERE rownum = 1";
|
||||
|
||||
return $this->GetRow($sql,$arr);
|
||||
}
|
||||
|
||||
/*
|
||||
This algorithm makes use of
|
||||
@@ -557,7 +571,7 @@ NATSOFT.DOMAIN =
|
||||
This implementation does not appear to work with oracle 8.0.5 or earlier. Comment
|
||||
out this function then, and the slower SelectLimit() in the base class will be used.
|
||||
*/
|
||||
function &SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
|
||||
function SelectLimit($sql,$nrows=-1,$offset=-1, $inputarr=false,$secs2cache=0)
|
||||
{
|
||||
// seems that oracle only supports 1 hint comment in 8i
|
||||
if ($this->firstrows) {
|
||||
@@ -567,7 +581,7 @@ NATSOFT.DOMAIN =
|
||||
$sql = preg_replace('/^[ \t\n]*select/i','SELECT /*+FIRST_ROWS*/',$sql);
|
||||
}
|
||||
|
||||
if ($offset < $this->selectOffsetAlg1) {
|
||||
if ($offset == -1 || ($offset < $this->selectOffsetAlg1 && 0 < $nrows && $nrows < 1000)) {
|
||||
if ($nrows > 0) {
|
||||
if ($offset > 0) $nrows += $offset;
|
||||
//$inputarr['adodb_rownum'] = $nrows;
|
||||
@@ -581,7 +595,7 @@ NATSOFT.DOMAIN =
|
||||
}
|
||||
// note that $nrows = 0 still has to work ==> no rows returned
|
||||
|
||||
$rs =& ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
|
||||
$rs = ADOConnection::SelectLimit($sql,$nrows,$offset,$inputarr,$secs2cache);
|
||||
return $rs;
|
||||
|
||||
} else {
|
||||
@@ -589,14 +603,14 @@ NATSOFT.DOMAIN =
|
||||
|
||||
// Let Oracle return the name of the columns
|
||||
$q_fields = "SELECT * FROM (".$sql.") WHERE NULL = NULL";
|
||||
|
||||
|
||||
$false = false;
|
||||
if (! $stmt_arr = $this->Prepare($q_fields)) {
|
||||
return $false;
|
||||
}
|
||||
$stmt = $stmt_arr[1];
|
||||
|
||||
if (is_array($inputarr)) {
|
||||
if (is_array($inputarr)) {
|
||||
foreach($inputarr as $k => $v) {
|
||||
if (is_array($v)) {
|
||||
if (sizeof($v) == 2) // suggested by g.giunta@libero.
|
||||
@@ -610,6 +624,7 @@ NATSOFT.DOMAIN =
|
||||
$bindarr[$k] = $v;
|
||||
} else { // dynamic sql, so rebind every time
|
||||
OCIBindByName($stmt,":$k",$inputarr[$k],$len);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -628,16 +643,17 @@ NATSOFT.DOMAIN =
|
||||
|
||||
OCIFreeStatement($stmt);
|
||||
$fields = implode(',', $cols);
|
||||
$nrows += $offset;
|
||||
if ($nrows <= 0) $nrows = 999999999999;
|
||||
else $nrows += $offset;
|
||||
$offset += 1; // in Oracle rownum starts at 1
|
||||
|
||||
if ($this->databaseType == 'oci8po') {
|
||||
$sql = "SELECT $fields FROM".
|
||||
$sql = "SELECT /*+ FIRST_ROWS */ $fields FROM".
|
||||
"(SELECT rownum as adodb_rownum, $fields FROM".
|
||||
" ($sql) WHERE rownum <= ?".
|
||||
") WHERE adodb_rownum >= ?";
|
||||
} else {
|
||||
$sql = "SELECT $fields FROM".
|
||||
$sql = "SELECT /*+ FIRST_ROWS */ $fields FROM".
|
||||
"(SELECT rownum as adodb_rownum, $fields FROM".
|
||||
" ($sql) WHERE rownum <= :adodb_nrows".
|
||||
") WHERE adodb_rownum >= :adodb_offset";
|
||||
@@ -645,8 +661,8 @@ NATSOFT.DOMAIN =
|
||||
$inputarr['adodb_nrows'] = $nrows;
|
||||
$inputarr['adodb_offset'] = $offset;
|
||||
|
||||
if ($secs2cache>0) $rs =& $this->CacheExecute($secs2cache, $sql,$inputarr);
|
||||
else $rs =& $this->Execute($sql,$inputarr);
|
||||
if ($secs2cache>0) $rs = $this->CacheExecute($secs2cache, $sql,$inputarr);
|
||||
else $rs = $this->Execute($sql,$inputarr);
|
||||
return $rs;
|
||||
}
|
||||
|
||||
@@ -704,7 +720,7 @@ NATSOFT.DOMAIN =
|
||||
}
|
||||
|
||||
/**
|
||||
* Usage: store file pointed to by $var in a blob
|
||||
* Usage: store file pointed to by $val in a blob
|
||||
*/
|
||||
function UpdateBlobFile($table,$column,$val,$where,$blobtype='BLOB')
|
||||
{
|
||||
@@ -739,11 +755,11 @@ NATSOFT.DOMAIN =
|
||||
* @param [inputarr] holds the input data to bind to. Null elements will be set to null.
|
||||
* @return RecordSet or false
|
||||
*/
|
||||
function &Execute($sql,$inputarr=false)
|
||||
function Execute($sql,$inputarr=false)
|
||||
{
|
||||
if ($this->fnExecute) {
|
||||
$fn = $this->fnExecute;
|
||||
$ret =& $fn($this,$sql,$inputarr);
|
||||
$ret = $fn($this,$sql,$inputarr);
|
||||
if (isset($ret)) return $ret;
|
||||
}
|
||||
if ($inputarr) {
|
||||
@@ -751,6 +767,7 @@ NATSOFT.DOMAIN =
|
||||
|
||||
$element0 = reset($inputarr);
|
||||
|
||||
if (!$this->_bindInputArray) {
|
||||
# is_object check because oci8 descriptors can be passed in
|
||||
if (is_array($element0) && !is_object(reset($element0))) {
|
||||
if (is_string($sql))
|
||||
@@ -759,15 +776,48 @@ NATSOFT.DOMAIN =
|
||||
$stmt = $sql;
|
||||
|
||||
foreach($inputarr as $arr) {
|
||||
$ret =& $this->_Execute($stmt,$arr);
|
||||
$ret = $this->_Execute($stmt,$arr);
|
||||
if (!$ret) return $ret;
|
||||
}
|
||||
} else {
|
||||
$ret =& $this->_Execute($sql,$inputarr);
|
||||
$sqlarr = explode(':',$sql);
|
||||
$sql = '';
|
||||
$lastnomatch = -2;
|
||||
#var_dump($sqlarr);echo "<hr>";var_dump($inputarr);echo"<hr>";
|
||||
foreach($sqlarr as $k => $str) {
|
||||
if ($k == 0) { $sql = $str; continue; }
|
||||
// we need $lastnomatch because of the following datetime,
|
||||
// eg. '10:10:01', which causes code to think that there is bind param :10 and :1
|
||||
$ok = preg_match('/^([0-9]*)/', $str, $arr);
|
||||
|
||||
if (!$ok) $sql .= $str;
|
||||
else {
|
||||
$at = $arr[1];
|
||||
if (isset($inputarr[$at]) || is_null($inputarr[$at])) {
|
||||
if ((strlen($at) == strlen($str) && $k < sizeof($arr)-1)) {
|
||||
$sql .= ':'.$str;
|
||||
$lastnomatch = $k;
|
||||
} else if ($lastnomatch == $k-1) {
|
||||
$sql .= ':'.$str;
|
||||
} else {
|
||||
if (is_null($inputarr[$at])) $sql .= 'null';
|
||||
else $sql .= $this->qstr($inputarr[$at]);
|
||||
$sql .= substr($str, strlen($at));
|
||||
}
|
||||
} else {
|
||||
$sql .= ':'.$str;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
$inputarr = false;
|
||||
}
|
||||
}
|
||||
$ret = $this->_Execute($sql,$inputarr);
|
||||
|
||||
|
||||
} else {
|
||||
$ret =& $this->_Execute($sql,false);
|
||||
$ret = $this->_Execute($sql,false);
|
||||
}
|
||||
|
||||
return $ret;
|
||||
@@ -818,7 +868,7 @@ NATSOFT.DOMAIN =
|
||||
array('VAR1' => 'Mr Bean'));
|
||||
|
||||
*/
|
||||
function &ExecuteCursor($sql,$cursorName='rs',$params=false)
|
||||
function ExecuteCursor($sql,$cursorName='rs',$params=false)
|
||||
{
|
||||
if (is_array($sql)) $stmt = $sql;
|
||||
else $stmt = ADODB_oci8::Prepare($sql,true); # true to allocate OCINewCursor
|
||||
@@ -835,7 +885,7 @@ NATSOFT.DOMAIN =
|
||||
} else
|
||||
$hasref = false;
|
||||
|
||||
$rs =& $this->Execute($stmt);
|
||||
$rs = $this->Execute($stmt);
|
||||
if ($rs) {
|
||||
if ($rs->databaseType == 'array') OCIFreeCursor($stmt[4]);
|
||||
else if ($hasref) $rs->_refcursor = $stmt[4];
|
||||
@@ -895,7 +945,7 @@ NATSOFT.DOMAIN =
|
||||
$this->_refLOBs[$numlob]['LOB'] = OCINewDescriptor($this->_connectionID, oci_lob_desc($type));
|
||||
$this->_refLOBs[$numlob]['TYPE'] = $isOutput;
|
||||
|
||||
$tmp = &$this->_refLOBs[$numlob]['LOB'];
|
||||
$tmp = $this->_refLOBs[$numlob]['LOB'];
|
||||
$rez = OCIBindByName($stmt[1], ":".$name, $tmp, -1, $type);
|
||||
if ($this->debug) {
|
||||
ADOConnection::outp("<b>Bind</b>: descriptor has been allocated, var (".$name.") binded");
|
||||
@@ -910,7 +960,7 @@ NATSOFT.DOMAIN =
|
||||
ADOConnection::outp("<b>Bind</b>: LOB has been written to temp");
|
||||
}
|
||||
} else {
|
||||
$this->_refLOBs[$numlob]['VAR'] = &$var;
|
||||
$this->_refLOBs[$numlob]['VAR'] = $var;
|
||||
}
|
||||
$rez = $tmp;
|
||||
} else {
|
||||
@@ -970,7 +1020,7 @@ NATSOFT.DOMAIN =
|
||||
$db->bind($stmt,1); $db->bind($stmt,2); $db->bind($stmt,3);
|
||||
$db->execute($stmt);
|
||||
*/
|
||||
function _query($sql,$inputarr)
|
||||
function _query($sql,$inputarr=false)
|
||||
{
|
||||
if (is_array($sql)) { // is prepared sql
|
||||
$stmt = $sql[1];
|
||||
@@ -981,7 +1031,7 @@ NATSOFT.DOMAIN =
|
||||
$bindpos = $sql[3];
|
||||
if (isset($this->_bind[$bindpos])) {
|
||||
// all tied up already
|
||||
$bindarr = &$this->_bind[$bindpos];
|
||||
$bindarr = $this->_bind[$bindpos];
|
||||
} else {
|
||||
// one statement to bind them all
|
||||
$bindarr = array();
|
||||
@@ -989,7 +1039,7 @@ NATSOFT.DOMAIN =
|
||||
$bindarr[$k] = $v;
|
||||
OCIBindByName($stmt,":$k",$bindarr[$k],is_string($v) && strlen($v)>4000 ? -1 : 4000);
|
||||
}
|
||||
$this->_bind[$bindpos] = &$bindarr;
|
||||
$this->_bind[$bindpos] = $bindarr;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1009,7 +1059,13 @@ NATSOFT.DOMAIN =
|
||||
else
|
||||
OCIBindByName($stmt,":$k",$inputarr[$k][0],$v[1],$v[2]);
|
||||
|
||||
if ($this->debug==99) echo "name=:$k",' var='.$inputarr[$k][0],' len='.$v[1],' type='.$v[2],'<br>';
|
||||
if ($this->debug==99) {
|
||||
if (is_object($v[0]))
|
||||
echo "name=:$k",' len='.$v[1],' type='.$v[2],'<br>';
|
||||
else
|
||||
echo "name=:$k",' var='.$inputarr[$k][0],' len='.$v[1],' type='.$v[2],'<br>';
|
||||
|
||||
}
|
||||
} else {
|
||||
$len = -1;
|
||||
if ($v === ' ') $len = 1;
|
||||
@@ -1076,6 +1132,32 @@ NATSOFT.DOMAIN =
|
||||
return false;
|
||||
}
|
||||
|
||||
// From Oracle Whitepaper: PHP Scalability and High Availability
|
||||
function IsConnectionError($err)
|
||||
{
|
||||
switch($err) {
|
||||
case 378: /* buffer pool param incorrect */
|
||||
case 602: /* core dump */
|
||||
case 603: /* fatal error */
|
||||
case 609: /* attach failed */
|
||||
case 1012: /* not logged in */
|
||||
case 1033: /* init or shutdown in progress */
|
||||
case 1043: /* Oracle not available */
|
||||
case 1089: /* immediate shutdown in progress */
|
||||
case 1090: /* shutdown in progress */
|
||||
case 1092: /* instance terminated */
|
||||
case 3113: /* disconnect */
|
||||
case 3114: /* not connected */
|
||||
case 3122: /* closing window */
|
||||
case 3135: /* lost contact */
|
||||
case 12153: /* TNS: not connected */
|
||||
case 27146: /* fatal or instance terminated */
|
||||
case 28511: /* Lost RPC */
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// returns true or false
|
||||
function _close()
|
||||
{
|
||||
@@ -1118,7 +1200,7 @@ SELECT /*+ RULE */ distinct b.column_name
|
||||
|
||||
$rs = $this->Execute($sql);
|
||||
if ($rs && !$rs->EOF) {
|
||||
$arr =& $rs->GetArray();
|
||||
$arr = $rs->GetArray();
|
||||
$a = array();
|
||||
foreach($arr as $v) {
|
||||
$a[] = reset($v);
|
||||
@@ -1149,7 +1231,7 @@ SELECT /*+ RULE */ distinct b.column_name
|
||||
from {$tabp}constraints
|
||||
where constraint_type = 'R' and table_name = $table $owner";
|
||||
|
||||
$constraints =& $this->GetArray($sql);
|
||||
$constraints = $this->GetArray($sql);
|
||||
$arr = false;
|
||||
foreach($constraints as $constr) {
|
||||
$cons = $this->qstr($constr[0]);
|
||||
@@ -1290,24 +1372,31 @@ class ADORecordset_oci8 extends ADORecordSet {
|
||||
fields in a certain query result. If the field offset isn't specified, the next field that wasn't yet retrieved by
|
||||
fetchField() is retrieved. */
|
||||
|
||||
function &_FetchField($fieldOffset = -1)
|
||||
function _FetchField($fieldOffset = -1)
|
||||
{
|
||||
$fld = new ADOFieldObject;
|
||||
$fieldOffset += 1;
|
||||
$fld->name =OCIcolumnname($this->_queryID, $fieldOffset);
|
||||
$fld->type = OCIcolumntype($this->_queryID, $fieldOffset);
|
||||
$fld->max_length = OCIcolumnsize($this->_queryID, $fieldOffset);
|
||||
if ($fld->type == 'NUMBER') {
|
||||
switch($fld->type) {
|
||||
case 'NUMBER':
|
||||
$p = OCIColumnPrecision($this->_queryID, $fieldOffset);
|
||||
$sc = OCIColumnScale($this->_queryID, $fieldOffset);
|
||||
if ($p != 0 && $sc == 0) $fld->type = 'INT';
|
||||
//echo " $this->name ($p.$sc) ";
|
||||
}
|
||||
break;
|
||||
|
||||
case 'CLOB':
|
||||
case 'NCLOB':
|
||||
case 'BLOB':
|
||||
$fld->max_length = -1;
|
||||
break;
|
||||
}
|
||||
return $fld;
|
||||
}
|
||||
|
||||
/* For some reason, OCIcolumnname fails when called after _initrs() so we cache it */
|
||||
function &FetchField($fieldOffset = -1)
|
||||
function FetchField($fieldOffset = -1)
|
||||
{
|
||||
return $this->_fieldobjs[$fieldOffset];
|
||||
}
|
||||
@@ -1345,7 +1434,7 @@ class ADORecordset_oci8 extends ADORecordSet {
|
||||
|
||||
/*
|
||||
# does not work as first record is retrieved in _initrs(), so is not included in GetArray()
|
||||
function &GetArray($nRows = -1)
|
||||
function GetArray($nRows = -1)
|
||||
{
|
||||
global $ADODB_OCI8_GETARRAY;
|
||||
|
||||
@@ -1364,7 +1453,7 @@ class ADORecordset_oci8 extends ADORecordSet {
|
||||
if (ADODB_ASSOC_CASE != 2 || $this->databaseType != 'oci8') break;
|
||||
|
||||
$ncols = @OCIfetchstatement($this->_queryID, $assoc, 0, $nRows, OCI_FETCHSTATEMENT_BY_ROW);
|
||||
$results =& array_merge(array($this->fields),$assoc);
|
||||
$results = array_merge(array($this->fields),$assoc);
|
||||
return $results;
|
||||
|
||||
default:
|
||||
@@ -1372,16 +1461,16 @@ class ADORecordset_oci8 extends ADORecordSet {
|
||||
}
|
||||
}
|
||||
|
||||
$results =& ADORecordSet::GetArray($nRows);
|
||||
$results = ADORecordSet::GetArray($nRows);
|
||||
return $results;
|
||||
|
||||
} */
|
||||
|
||||
/* Optimize SelectLimit() by using OCIFetch() instead of OCIFetchInto() */
|
||||
function &GetArrayLimit($nrows,$offset=-1)
|
||||
function GetArrayLimit($nrows,$offset=-1)
|
||||
{
|
||||
if ($offset <= 0) {
|
||||
$arr =& $this->GetArray($nrows);
|
||||
$arr = $this->GetArray($nrows);
|
||||
return $arr;
|
||||
}
|
||||
$arr = array();
|
||||
|
||||
Reference in New Issue
Block a user