Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/adodb/drivers/adodb-db2ora.inc.php
Go to the documentation of this file.
00001 <?php
00002 /* 
00003 V5.14 8 Sept 2011  (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
00004   Released under both BSD license and Lesser GPL library license. 
00005   Whenever there is any discrepancy between the two licenses, 
00006   the BSD license will take precedence. 
00007 Set tabs to 4 for best viewing.
00008   
00009   Latest version is available at http://adodb.sourceforge.net
00010   
00011   Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows.
00012 */
00013 
00014 // security - hide paths
00015 if (!defined('ADODB_DIR')) die();
00016 include(ADODB_DIR."/drivers/adodb-db2.inc.php");
00017 
00018 
00019 if (!defined('ADODB_DB2OCI')){
00020 define('ADODB_DB2OCI',1);
00021 
00022 
00023 function _colontrack($p)
00024 {
00025 global $_COLONARR,$_COLONSZ;
00026         $v = (integer) substr($p,1);
00027         if ($v > $_COLONSZ) return $p;
00028         $_COLONARR[] = $v;
00029         return '?';
00030 }
00031 
00032 function _colonscope($sql,$arr)
00033 {
00034 global $_COLONARR,$_COLONSZ;
00035 
00036         $_COLONARR = array();
00037         $_COLONSZ = sizeof($arr);
00038         
00039         $sql2 = preg_replace("/(:[0-9]+)/e","_colontrack('\\1')",$sql);
00040         
00041         if (empty($_COLONARR)) return array($sql,$arr);
00042         
00043         foreach($_COLONARR as $k => $v) {
00044                 $arr2[] = $arr[$v]; 
00045         }
00046         
00047         return array($sql2,$arr2);
00048 }
00049 
00050 class ADODB_db2oci extends ADODB_db2 {
00051         var $databaseType = "db2oci";   
00052         var $sysTimeStamp = 'sysdate';
00053         var $sysDate = 'trunc(sysdate)';
00054         
00055         function ADODB_db2oci()
00056         {
00057                 $this->ADODB_db2();
00058         }
00059         
00060         
00061         function _Execute($sql, $inputarr)
00062         {
00063                 if ($inputarr) list($sql,$inputarr) = _colonscope($sql, $inputarr);
00064                 return parent::_Execute($sql, $inputarr);
00065         }
00066 };
00067  
00068 
00069 class  ADORecordSet_db2oci extends ADORecordSet_odbc {  
00070         
00071         var $databaseType = "db2oci";           
00072         
00073         function ADORecordSet_db2oci($id,$mode=false)
00074         {
00075                 return $this->ADORecordSet_db2($id,$mode);
00076         }
00077 }
00078 
00079 } //define
00080 ?>
 All Data Structures Namespaces Files Functions Variables Enumerations