Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

   1  <?php
   2  /*
   3  @version   v5.21.0  2021-02-27
   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 https://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  }
  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  }