Source for file adodb-oci8po.inc.php
Documentation is available at adodb-oci8po.inc.php
V4.97 22 Jan 2008 (c) 2000-2008 John Lim. All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.
Latest version is available at http://adodb.sourceforge.net
Portable version of oci8 driver, to make it more similar to other database drivers.
1. that the OCI_ASSOC names are in lowercase instead of uppercase.
2. bind variables are mapped using ? instead of :<bindvar>
Should some emulation of RecordCount() be implemented?
include_once(ADODB_DIR. '/drivers/adodb-oci8.inc.php');
var $metaColumnsSQL = "select lower(cname),coltype,width, SCALE, PRECISION, NULLS, DEFAULTVAL from col where tname='%s' order by colno"; //changed by smondino@users.sourceforge. net
var $metaTablesSQL = "select lower(table_name),table_type from cat where table_type in ('TABLE','VIEW')";
# oci8po does not support adodb extension: adodb_movenext()
function Prepare($sql,$cursor= false)
for ($i = 1, $max = sizeof($sqlarr); $i < $max; $i++ ) {
$sql .= ':'. ($i- 1) . $sqlarr[$i];
// emulate handling of parameters ? ?, replacing with :bind0 :bind1
function _query($sql,$inputarr)
foreach($inputarr as $v) {
foreach($inputarr as $k => $v) {
$sql .= ":$k" . $sqlarr[++ $i];
/*--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------*/
// lowercase field names...
$fld->type = OCIcolumntype($this->_queryID, $fieldOffset);
$fld->max_length = OCIcolumnsize($this->_queryID, $fieldOffset);
if ($fld->type == 'NUMBER') {
//$p = OCIColumnPrecision($this->_queryID, $fieldOffset);
$sc = OCIColumnScale($this->_queryID, $fieldOffset);
if ($sc == 0) $fld->type = 'INT';
if (@OCIfetchinto($this->_queryID,$this->fields,$this->fetchMode)) {
// 10% speedup to move MoveNext to child class
global $ADODB_ANSI_PADDING_OFF;
if (!empty($ADODB_ANSI_PADDING_OFF)) {
foreach($this->fields as $k => $v) {
/* Optimize SelectLimit() by using OCIFetch() instead of OCIFetchInto() */
for ($i= 1; $i < $offset; $i++ )
while (!$this->EOF && $nrows != $cnt) {
$results[$cnt++ ] = $this->fields;
// Create associative array
if (ADODB_ASSOC_CASE == 2) return; // native
$lowercase = (ADODB_ASSOC_CASE == 0);
foreach($this->fields as $k => $v) {
global $ADODB_ANSI_PADDING_OFF;
if (!empty($ADODB_ANSI_PADDING_OFF)) {
foreach($this->fields as $k => $v) {
|