~ubuntu-branches/ubuntu/maverick/mahara/maverick-updates

« back to all changes in this revision

Viewing changes to htdocs/lib/adodb/datadict/datadict-generic.inc.php

  • Committer: Bazaar Package Importer
  • Author(s): Nigel McNie
  • Date: 2008-04-29 11:15:39 UTC
  • Revision ID: james.westby@ubuntu.com-20080429111539-b28eqkagavaub2zr
Tags: upstream-1.0.2
ImportĀ upstreamĀ versionĀ 1.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
 
 
3
/**
 
4
  V4.92a 29 Aug 2006  (c) 2000-2006 John Lim (jlim#natsoft.com.my). 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.
 
8
        
 
9
  Set tabs to 4 for best viewing.
 
10
 
 
11
*/
 
12
 
 
13
// security - hide paths
 
14
if (!defined('ADODB_DIR')) die();
 
15
 
 
16
class ADODB2_generic extends ADODB_DataDict {
 
17
        
 
18
        var $databaseType = 'generic';
 
19
        var $seqField = false;
 
20
        
 
21
        
 
22
        function ActualType($meta)
 
23
        {
 
24
                switch($meta) {
 
25
                case 'C': return 'VARCHAR';
 
26
                case 'XL':
 
27
                case 'X': return 'VARCHAR(250)';
 
28
                
 
29
                case 'C2': return 'VARCHAR';
 
30
                case 'X2': return 'VARCHAR(250)';
 
31
                
 
32
                case 'B': return 'VARCHAR';
 
33
                        
 
34
                case 'D': return 'DATE';
 
35
                case 'T': return 'DATE';
 
36
                
 
37
                case 'L': return 'DECIMAL(1)';
 
38
                case 'I': return 'DECIMAL(10)';
 
39
                case 'I1': return 'DECIMAL(3)';
 
40
                case 'I2': return 'DECIMAL(5)';
 
41
                case 'I4': return 'DECIMAL(10)';
 
42
                case 'I8': return 'DECIMAL(20)';
 
43
                
 
44
                case 'F': return 'DECIMAL(32,8)';
 
45
                case 'N': return 'DECIMAL';
 
46
                default:
 
47
                        return $meta;
 
48
                }
 
49
        }
 
50
 
 
51
        function AlterColumnSQL($tabname, $flds)
 
52
        {
 
53
                if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
 
54
                return array();
 
55
        }
 
56
        
 
57
        
 
58
        function DropColumnSQL($tabname, $flds)
 
59
        {
 
60
                if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
 
61
                return array();
 
62
        }
 
63
        
 
64
}
 
65
 
 
66
/*
 
67
//db2
 
68
        function ActualType($meta)
 
69
        {
 
70
                switch($meta) {
 
71
                case 'C': return 'VARCHAR';
 
72
                case 'X': return 'VARCHAR'; 
 
73
                
 
74
                case 'C2': return 'VARCHAR'; // up to 32K
 
75
                case 'X2': return 'VARCHAR';
 
76
                
 
77
                case 'B': return 'BLOB';
 
78
                        
 
79
                case 'D': return 'DATE';
 
80
                case 'T': return 'TIMESTAMP';
 
81
                
 
82
                case 'L': return 'SMALLINT';
 
83
                case 'I': return 'INTEGER';
 
84
                case 'I1': return 'SMALLINT';
 
85
                case 'I2': return 'SMALLINT';
 
86
                case 'I4': return 'INTEGER';
 
87
                case 'I8': return 'BIGINT';
 
88
                
 
89
                case 'F': return 'DOUBLE';
 
90
                case 'N': return 'DECIMAL';
 
91
                default:
 
92
                        return $meta;
 
93
                }
 
94
        }
 
95
        
 
96
// ifx
 
97
function ActualType($meta)
 
98
        {
 
99
                switch($meta) {
 
100
                case 'C': return 'VARCHAR';// 255
 
101
                case 'X': return 'TEXT'; 
 
102
                
 
103
                case 'C2': return 'NVARCHAR';
 
104
                case 'X2': return 'TEXT';
 
105
                
 
106
                case 'B': return 'BLOB';
 
107
                        
 
108
                case 'D': return 'DATE';
 
109
                case 'T': return 'DATETIME';
 
110
                
 
111
                case 'L': return 'SMALLINT';
 
112
                case 'I': return 'INTEGER';
 
113
                case 'I1': return 'SMALLINT';
 
114
                case 'I2': return 'SMALLINT';
 
115
                case 'I4': return 'INTEGER';
 
116
                case 'I8': return 'DECIMAL(20)';
 
117
                
 
118
                case 'F': return 'FLOAT';
 
119
                case 'N': return 'DECIMAL';
 
120
                default:
 
121
                        return $meta;
 
122
                }
 
123
        }
 
124
*/
 
125
?>
 
 
b'\\ No newline at end of file'