Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403]

   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
  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  	function __construct()
  32  	 {
  33  	 }
  34  
  35  }
  36  
  37  /*--------------------------------------------------------------------------------------
  38  	 	  Class Name: Recordset
  39  --------------------------------------------------------------------------------------*/
  40  
  41  class 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  }