new approach to logging database access and upgraded adodb
[openemr.git] / library / adodb / datadict / datadict-informix.inc.php
blobcffb556392adc6911d985be76d508ae19e9249e6
1 <?php
3 /**
4 V5.14 8 Sept 2011 (c) 2000-2011 John Lim (jlim#natsoft.com). All rights reserved.
5 Released under both BSD license and Lesser GPL library license.
6 Whenever there is any discrepancy between the two licenses,
7 the BSD license will take precedence.
9 Set tabs to 4 for best viewing.
13 // security - hide paths
14 if (!defined('ADODB_DIR')) die();
16 class ADODB2_informix extends ADODB_DataDict {
18 var $databaseType = 'informix';
19 var $seqField = false;
22 function ActualType($meta)
24 switch($meta) {
25 case 'C': return 'VARCHAR';// 255
26 case 'XL':
27 case 'X': return 'TEXT';
29 case 'C2': return 'NVARCHAR';
30 case 'X2': return 'TEXT';
32 case 'B': return 'BLOB';
34 case 'D': return 'DATE';
35 case 'TS':
36 case 'T': return 'DATETIME YEAR TO SECOND';
38 case 'L': return 'SMALLINT';
39 case 'I': return 'INTEGER';
40 case 'I1': return 'SMALLINT';
41 case 'I2': return 'SMALLINT';
42 case 'I4': return 'INTEGER';
43 case 'I8': return 'DECIMAL(20)';
45 case 'F': return 'FLOAT';
46 case 'N': return 'DECIMAL';
47 default:
48 return $meta;
52 function AlterColumnSQL($tabname, $flds)
54 if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
55 return array();
59 function DropColumnSQL($tabname, $flds)
61 if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
62 return array();
65 // return string must begin with space
66 function _CreateSuffix($fname, &$ftype, $fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned)
68 if ($fautoinc) {
69 $ftype = 'SERIAL';
70 return '';
72 $suffix = '';
73 if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
74 if ($fnotnull) $suffix .= ' NOT NULL';
75 if ($fconstraint) $suffix .= ' '.$fconstraint;
76 return $suffix;