updated adodb package to work with php 7.1
[openemr.git] / vendor / adodb / adodb-php / drivers / adodb-db2ora.inc.php
blob1261689dbbd434deb87f58874591376b5ced2c84
1 <?php
2 /*
3 @version v5.20.9 21-Dec-2016
4 @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). 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 Set tabs to 4 for best viewing.
11 Latest version is available at http://adodb.sourceforge.net
13 Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows.
16 // security - hide paths
17 if (!defined('ADODB_DIR')) die();
18 include(ADODB_DIR."/drivers/adodb-db2.inc.php");
21 if (!defined('ADODB_DB2OCI')){
22 define('ADODB_DB2OCI',1);
25 /**
26 * Callback function for preg_replace in _colonscope()
27 * @param array $p matched patterns
28 * return string '?' if parameter replaced, :N if not
30 function _colontrack($p)
32 global $_COLONARR, $_COLONSZ;
33 $v = (integer) substr($p[1], 1);
34 if ($v > $_COLONSZ) return $p[1];
35 $_COLONARR[] = $v;
36 return '?';
39 /**
40 * smart remapping of :0, :1 bind vars to ? ?
41 * @param string $sql SQL statement
42 * @param array $arr parameters
43 * @return array
45 function _colonscope($sql,$arr)
47 global $_COLONARR,$_COLONSZ;
49 $_COLONARR = array();
50 $_COLONSZ = sizeof($arr);
52 $sql2 = preg_replace_callback('/(:[0-9]+)/', '_colontrack', $sql);
54 if (empty($_COLONARR)) return array($sql,$arr);
56 foreach($_COLONARR as $k => $v) {
57 $arr2[] = $arr[$v];
60 return array($sql2,$arr2);
63 class ADODB_db2oci extends ADODB_db2 {
64 var $databaseType = "db2oci";
65 var $sysTimeStamp = 'sysdate';
66 var $sysDate = 'trunc(sysdate)';
68 function _Execute($sql, $inputarr = false)
70 if ($inputarr) list($sql,$inputarr) = _colonscope($sql, $inputarr);
71 return parent::_Execute($sql, $inputarr);
76 class ADORecordSet_db2oci extends ADORecordSet_odbc {
78 var $databaseType = "db2oci";
80 function __construct($id,$mode=false)
82 return parent::__construct($id,$mode);
86 } //define