1<?php
2/*
3@version   v5.20.16  12-Jan-2020
4@copyright (c) 2000-2013 John Lim. All rights reserved.
5@copyright (c) 2014      Damien Regad, Mark Newnham and the ADOdb community
6  Released under both BSD license and Lesser GPL library license.
7  Whenever there is any discrepancy between the two licenses,
8  the BSD license will take precedence.
9
10  Latest version is available at http://adodb.org/
11
12  Portable version of oci8 driver, to make it more similar to other database drivers.
13  The main differences are
14
15   1. that the OCI_ASSOC names are in lowercase instead of uppercase.
16   2. bind variables are mapped using ? instead of :<bindvar>
17
18   Should some emulation of RecordCount() be implemented?
19
20*/
21
22// security - hide paths
23if (!defined('ADODB_DIR')) die();
24
25include_once(ADODB_DIR.'/drivers/adodb-oci8.inc.php');
26
27class ADODB_oci8quercus extends ADODB_oci8 {
28	var $databaseType = 'oci8quercus';
29	var $dataProvider = 'oci8';
30
31	function __construct()
32	{
33	}
34
35}
36
37/*--------------------------------------------------------------------------------------
38		 Class Name: Recordset
39--------------------------------------------------------------------------------------*/
40
41class ADORecordset_oci8quercus extends ADORecordset_oci8 {
42
43	var $databaseType = 'oci8quercus';
44
45	function __construct($queryID,$mode=false)
46	{
47		parent::__construct($queryID,$mode);
48	}
49
50	function _FetchField($fieldOffset = -1)
51	{
52	global $QUERCUS;
53		$fld = new ADOFieldObject;
54
55		if (!empty($QUERCUS)) {
56			$fld->name = oci_field_name($this->_queryID, $fieldOffset);
57			$fld->type = oci_field_type($this->_queryID, $fieldOffset);
58			$fld->max_length = oci_field_size($this->_queryID, $fieldOffset);
59
60			//if ($fld->name == 'VAL6_NUM_12_4') $fld->type = 'NUMBER';
61			switch($fld->type) {
62				case 'string': $fld->type = 'VARCHAR'; break;
63				case 'real': $fld->type = 'NUMBER'; break;
64			}
65		} else {
66			$fieldOffset += 1;
67			$fld->name = oci_field_name($this->_queryID, $fieldOffset);
68			$fld->type = oci_field_type($this->_queryID, $fieldOffset);
69			$fld->max_length = oci_field_size($this->_queryID, $fieldOffset);
70		}
71	 	switch($fld->type) {
72		case 'NUMBER':
73	 		$p = oci_field_precision($this->_queryID, $fieldOffset);
74			$sc = oci_field_scale($this->_queryID, $fieldOffset);
75			if ($p != 0 && $sc == 0) $fld->type = 'INT';
76			$fld->scale = $p;
77			break;
78
79	 	case 'CLOB':
80		case 'NCLOB':
81		case 'BLOB':
82			$fld->max_length = -1;
83			break;
84		}
85
86		return $fld;
87	}
88
89}
90