minor bug fixes
[openemr.git] / library / adodb / datadict / datadict-generic.inc.php
blob0cd20e89a86b85110ecdaef8178e676e7bee891d
1 <?php
3 /**
4 @version v5.20.2 27-Dec-2015
5 @copyright (c) 2000-2013 John Lim (jlim#natsoft.com). All rights reserved.
6 @copyright (c) 2014 Damien Regad, Mark Newnham and the ADOdb community
7 Released under both BSD license and Lesser GPL library license.
8 Whenever there is any discrepancy between the two licenses,
9 the BSD license will take precedence.
11 Set tabs to 4 for best viewing.
15 // security - hide paths
16 if (!defined('ADODB_DIR')) die();
18 class ADODB2_generic extends ADODB_DataDict {
20 var $databaseType = 'generic';
21 var $seqField = false;
24 function ActualType($meta)
26 switch($meta) {
27 case 'C': return 'VARCHAR';
28 case 'XL':
29 case 'X': return 'VARCHAR(250)';
31 case 'C2': return 'VARCHAR';
32 case 'X2': return 'VARCHAR(250)';
34 case 'B': return 'VARCHAR';
36 case 'D': return 'DATE';
37 case 'TS':
38 case 'T': return 'DATE';
40 case 'L': return 'DECIMAL(1)';
41 case 'I': return 'DECIMAL(10)';
42 case 'I1': return 'DECIMAL(3)';
43 case 'I2': return 'DECIMAL(5)';
44 case 'I4': return 'DECIMAL(10)';
45 case 'I8': return 'DECIMAL(20)';
47 case 'F': return 'DECIMAL(32,8)';
48 case 'N': return 'DECIMAL';
49 default:
50 return $meta;
54 function AlterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
56 if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
57 return array();
61 function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
63 if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
64 return array();
70 //db2
71 function ActualType($meta)
73 switch($meta) {
74 case 'C': return 'VARCHAR';
75 case 'X': return 'VARCHAR';
77 case 'C2': return 'VARCHAR'; // up to 32K
78 case 'X2': return 'VARCHAR';
80 case 'B': return 'BLOB';
82 case 'D': return 'DATE';
83 case 'T': return 'TIMESTAMP';
85 case 'L': return 'SMALLINT';
86 case 'I': return 'INTEGER';
87 case 'I1': return 'SMALLINT';
88 case 'I2': return 'SMALLINT';
89 case 'I4': return 'INTEGER';
90 case 'I8': return 'BIGINT';
92 case 'F': return 'DOUBLE';
93 case 'N': return 'DECIMAL';
94 default:
95 return $meta;
99 // ifx
100 function ActualType($meta)
102 switch($meta) {
103 case 'C': return 'VARCHAR';// 255
104 case 'X': return 'TEXT';
106 case 'C2': return 'NVARCHAR';
107 case 'X2': return 'TEXT';
109 case 'B': return 'BLOB';
111 case 'D': return 'DATE';
112 case 'T': return 'DATETIME';
114 case 'L': return 'SMALLINT';
115 case 'I': return 'INTEGER';
116 case 'I1': return 'SMALLINT';
117 case 'I2': return 'SMALLINT';
118 case 'I4': return 'INTEGER';
119 case 'I8': return 'DECIMAL(20)';
121 case 'F': return 'FLOAT';
122 case 'N': return 'DECIMAL';
123 default:
124 return $meta;