datadict-generic.inc.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?php
  2. /**
  3. @version v5.20.17 31-Mar-2020
  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.
  10. */
  11. // security - hide paths
  12. if (!defined('ADODB_DIR')) die();
  13. class ADODB2_generic extends ADODB_DataDict {
  14. var $databaseType = 'generic';
  15. var $seqField = false;
  16. function ActualType($meta)
  17. {
  18. switch($meta) {
  19. case 'C': return 'VARCHAR';
  20. case 'XL':
  21. case 'X': return 'VARCHAR(250)';
  22. case 'C2': return 'VARCHAR';
  23. case 'X2': return 'VARCHAR(250)';
  24. case 'B': return 'VARCHAR';
  25. case 'D': return 'DATE';
  26. case 'TS':
  27. case 'T': return 'DATE';
  28. case 'L': return 'DECIMAL(1)';
  29. case 'I': return 'DECIMAL(10)';
  30. case 'I1': return 'DECIMAL(3)';
  31. case 'I2': return 'DECIMAL(5)';
  32. case 'I4': return 'DECIMAL(10)';
  33. case 'I8': return 'DECIMAL(20)';
  34. case 'F': return 'DECIMAL(32,8)';
  35. case 'N': return 'DECIMAL';
  36. default:
  37. return $meta;
  38. }
  39. }
  40. function AlterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
  41. {
  42. if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
  43. return array();
  44. }
  45. function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
  46. {
  47. if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
  48. return array();
  49. }
  50. }
  51. /*
  52. //db2
  53. function ActualType($meta)
  54. {
  55. switch($meta) {
  56. case 'C': return 'VARCHAR';
  57. case 'X': return 'VARCHAR';
  58. case 'C2': return 'VARCHAR'; // up to 32K
  59. case 'X2': return 'VARCHAR';
  60. case 'B': return 'BLOB';
  61. case 'D': return 'DATE';
  62. case 'T': return 'TIMESTAMP';
  63. case 'L': return 'SMALLINT';
  64. case 'I': return 'INTEGER';
  65. case 'I1': return 'SMALLINT';
  66. case 'I2': return 'SMALLINT';
  67. case 'I4': return 'INTEGER';
  68. case 'I8': return 'BIGINT';
  69. case 'F': return 'DOUBLE';
  70. case 'N': return 'DECIMAL';
  71. default:
  72. return $meta;
  73. }
  74. }
  75. // ifx
  76. function ActualType($meta)
  77. {
  78. switch($meta) {
  79. case 'C': return 'VARCHAR';// 255
  80. case 'X': return 'TEXT';
  81. case 'C2': return 'NVARCHAR';
  82. case 'X2': return 'TEXT';
  83. case 'B': return 'BLOB';
  84. case 'D': return 'DATE';
  85. case 'T': return 'DATETIME';
  86. case 'L': return 'SMALLINT';
  87. case 'I': return 'INTEGER';
  88. case 'I1': return 'SMALLINT';
  89. case 'I2': return 'SMALLINT';
  90. case 'I4': return 'INTEGER';
  91. case 'I8': return 'DECIMAL(20)';
  92. case 'F': return 'FLOAT';
  93. case 'N': return 'DECIMAL';
  94. default:
  95. return $meta;
  96. }
  97. }
  98. */