1 |
efrain |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* Oracle "quercus" driver.
|
|
|
4 |
*
|
|
|
5 |
* This file is part of ADOdb, a Database Abstraction Layer library for PHP.
|
|
|
6 |
*
|
|
|
7 |
* @package ADOdb
|
|
|
8 |
* @link https://adodb.org Project's web site and documentation
|
|
|
9 |
* @link https://github.com/ADOdb/ADOdb Source code and issue tracker
|
|
|
10 |
*
|
|
|
11 |
* The ADOdb Library is dual-licensed, released under both the BSD 3-Clause
|
|
|
12 |
* and the GNU Lesser General Public Licence (LGPL) v2.1 or, at your option,
|
|
|
13 |
* any later version. This means you can use it in proprietary products.
|
|
|
14 |
* See the LICENSE.md file distributed with this source code for details.
|
|
|
15 |
* @license BSD-3-Clause
|
|
|
16 |
* @license LGPL-2.1-or-later
|
|
|
17 |
*
|
|
|
18 |
* @copyright 2000-2013 John Lim
|
|
|
19 |
* @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community
|
|
|
20 |
*/
|
|
|
21 |
|
|
|
22 |
// security - hide paths
|
|
|
23 |
if (!defined('ADODB_DIR')) die();
|
|
|
24 |
|
|
|
25 |
include_once(ADODB_DIR.'/drivers/adodb-oci8.inc.php');
|
|
|
26 |
|
|
|
27 |
class ADODB_oci8quercus extends ADODB_oci8 {
|
|
|
28 |
var $databaseType = 'oci8quercus';
|
|
|
29 |
var $dataProvider = 'oci8';
|
|
|
30 |
|
|
|
31 |
}
|
|
|
32 |
|
|
|
33 |
/*--------------------------------------------------------------------------------------
|
|
|
34 |
Class Name: Recordset
|
|
|
35 |
--------------------------------------------------------------------------------------*/
|
|
|
36 |
|
|
|
37 |
class ADORecordset_oci8quercus extends ADORecordset_oci8 {
|
|
|
38 |
|
|
|
39 |
var $databaseType = 'oci8quercus';
|
|
|
40 |
|
|
|
41 |
function _FetchField($fieldOffset = -1)
|
|
|
42 |
{
|
|
|
43 |
global $QUERCUS;
|
|
|
44 |
$fld = new ADOFieldObject;
|
|
|
45 |
|
|
|
46 |
if (!empty($QUERCUS)) {
|
|
|
47 |
$fld->name = oci_field_name($this->_queryID, $fieldOffset);
|
|
|
48 |
$fld->type = oci_field_type($this->_queryID, $fieldOffset);
|
|
|
49 |
$fld->max_length = oci_field_size($this->_queryID, $fieldOffset);
|
|
|
50 |
|
|
|
51 |
//if ($fld->name == 'VAL6_NUM_12_4') $fld->type = 'NUMBER';
|
|
|
52 |
switch($fld->type) {
|
|
|
53 |
case 'string': $fld->type = 'VARCHAR'; break;
|
|
|
54 |
case 'real': $fld->type = 'NUMBER'; break;
|
|
|
55 |
}
|
|
|
56 |
} else {
|
|
|
57 |
$fieldOffset += 1;
|
|
|
58 |
$fld->name = oci_field_name($this->_queryID, $fieldOffset);
|
|
|
59 |
$fld->type = oci_field_type($this->_queryID, $fieldOffset);
|
|
|
60 |
$fld->max_length = oci_field_size($this->_queryID, $fieldOffset);
|
|
|
61 |
}
|
|
|
62 |
switch($fld->type) {
|
|
|
63 |
case 'NUMBER':
|
|
|
64 |
$p = oci_field_precision($this->_queryID, $fieldOffset);
|
|
|
65 |
$sc = oci_field_scale($this->_queryID, $fieldOffset);
|
|
|
66 |
if ($p != 0 && $sc == 0) $fld->type = 'INT';
|
|
|
67 |
$fld->scale = $p;
|
|
|
68 |
break;
|
|
|
69 |
|
|
|
70 |
case 'CLOB':
|
|
|
71 |
case 'NCLOB':
|
|
|
72 |
case 'BLOB':
|
|
|
73 |
$fld->max_length = -1;
|
|
|
74 |
break;
|
|
|
75 |
}
|
|
|
76 |
|
|
|
77 |
return $fld;
|
|
|
78 |
}
|
|
|
79 |
|
|
|
80 |
}
|