PageRenderTime 38ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/concrete/libraries/3rdparty/adodb/drivers/adodb-db2ora.inc.php

https://bitbucket.org/selfeky/xclusivescardwebsite
PHP | 80 lines | 48 code | 20 blank | 12 comment | 5 complexity | b205dba5f2f533b0656b9d0a0800a1ad MD5 | raw file
  1. <?php
  2. /*
  3. V5.18 3 Sep 2012 (c) 2000-2012 John Lim (jlim#natsoft.com). All rights reserved.
  4. Released under both BSD license and Lesser GPL library license.
  5. Whenever there is any discrepancy between the two licenses,
  6. the BSD license will take precedence.
  7. Set tabs to 4 for best viewing.
  8. Latest version is available at http://adodb.sourceforge.net
  9. Microsoft Visual FoxPro data driver. Requires ODBC. Works only on MS Windows.
  10. */
  11. // security - hide paths
  12. if (!defined('ADODB_DIR')) die();
  13. include(ADODB_DIR."/drivers/adodb-db2.inc.php");
  14. if (!defined('ADODB_DB2OCI')){
  15. define('ADODB_DB2OCI',1);
  16. function _colontrack($p)
  17. {
  18. global $_COLONARR,$_COLONSZ;
  19. $v = (integer) substr($p,1);
  20. if ($v > $_COLONSZ) return $p;
  21. $_COLONARR[] = $v;
  22. return '?';
  23. }
  24. function _colonscope($sql,$arr)
  25. {
  26. global $_COLONARR,$_COLONSZ;
  27. $_COLONARR = array();
  28. $_COLONSZ = sizeof($arr);
  29. $sql2 = preg_replace("/(:[0-9]+)/e","_colontrack('\\1')",$sql);
  30. if (empty($_COLONARR)) return array($sql,$arr);
  31. foreach($_COLONARR as $k => $v) {
  32. $arr2[] = $arr[$v];
  33. }
  34. return array($sql2,$arr2);
  35. }
  36. class ADODB_db2oci extends ADODB_db2 {
  37. var $databaseType = "db2oci";
  38. var $sysTimeStamp = 'sysdate';
  39. var $sysDate = 'trunc(sysdate)';
  40. function ADODB_db2oci()
  41. {
  42. $this->ADODB_db2();
  43. }
  44. function _Execute($sql, $inputarr)
  45. {
  46. if ($inputarr) list($sql,$inputarr) = _colonscope($sql, $inputarr);
  47. return parent::_Execute($sql, $inputarr);
  48. }
  49. };
  50. class ADORecordSet_db2oci extends ADORecordSet_odbc {
  51. var $databaseType = "db2oci";
  52. function ADORecordSet_db2oci($id,$mode=false)
  53. {
  54. return $this->ADORecordSet_db2($id,$mode);
  55. }
  56. }
  57. } //define
  58. ?>