1--TEST--
2odbc_gettypeinfo(): Getting info about data types
3--EXTENSIONS--
4odbc
5--SKIPIF--
6<?php include 'skipif.inc'; ?>
7--FILE--
8<?php
9
10include 'config.inc';
11
12$conn = odbc_connect($dsn, $user, $pass);
13
14$res = odbc_gettypeinfo($conn, 0);
15var_dump(odbc_fetch_array($res));
16odbc_free_result($res);
17
18$res = odbc_gettypeinfo($conn, 1);
19var_dump(odbc_fetch_array($res));
20odbc_free_result($res);
21
22$res = odbc_gettypeinfo($conn, 2);
23var_dump(odbc_fetch_array($res));
24odbc_free_result($res);
25
26odbc_close($conn);
27?>
28--EXPECTF--
29array(20) {
30  ["TYPE_NAME"]=>
31  string(14) "datetimeoffset"
32  ["DATA_TYPE"]=>
33  string(4) "-155"
34  ["COLUMN_SIZE"]=>
35  string(2) "34"
36  ["LITERAL_PREFIX"]=>
37  string(1) "'"
38  ["LITERAL_SUFFIX"]=>
39  string(1) "'"
40  ["CREATE_PARAMS"]=>
41  string(5) "scale"
42  ["NULLABLE"]=>
43  string(1) "1"
44  ["CASE_SENSITIVE"]=>
45  string(1) "0"
46  ["SEARCHABLE"]=>
47  string(1) "3"
48  ["UNSIGNED_ATTRIBUTE"]=>
49  NULL
50  ["FIXED_PREC_SCALE"]=>
51  string(1) "0"
52  ["AUTO_UNIQUE_VALUE"]=>
53  NULL
54  ["LOCAL_TYPE_NAME"]=>
55  string(14) "datetimeoffset"
56  ["MINIMUM_SCALE"]=>
57  string(1) "0"
58  ["MAXIMUM_SCALE"]=>
59  string(1) "7"
60  ["SQL_DATA_TYPE"]=>
61  string(4) "-155"
62  ["SQL_DATETIME_SUB"]=>
63  string(1) "0"
64  ["NUM_PREC_RADIX"]=>
65  NULL
66  ["INTERVAL_PRECISION"]=>
67  NULL
68  ["USERTYPE"]=>
69  string(1) "0"
70}
71array(20) {
72  ["TYPE_NAME"]=>
73  string(4) "char"
74  ["DATA_TYPE"]=>
75  string(1) "1"
76  ["COLUMN_SIZE"]=>
77  string(4) "8000"
78  ["LITERAL_PREFIX"]=>
79  string(1) "'"
80  ["LITERAL_SUFFIX"]=>
81  string(1) "'"
82  ["CREATE_PARAMS"]=>
83  string(6) "length"
84  ["NULLABLE"]=>
85  string(1) "1"
86  ["CASE_SENSITIVE"]=>
87  string(1) "0"
88  ["SEARCHABLE"]=>
89  string(1) "3"
90  ["UNSIGNED_ATTRIBUTE"]=>
91  NULL
92  ["FIXED_PREC_SCALE"]=>
93  string(1) "0"
94  ["AUTO_UNIQUE_VALUE"]=>
95  NULL
96  ["LOCAL_TYPE_NAME"]=>
97  string(4) "char"
98  ["MINIMUM_SCALE"]=>
99  NULL
100  ["MAXIMUM_SCALE"]=>
101  NULL
102  ["SQL_DATA_TYPE"]=>
103  string(1) "1"
104  ["SQL_DATETIME_SUB"]=>
105  NULL
106  ["NUM_PREC_RADIX"]=>
107  NULL
108  ["INTERVAL_PRECISION"]=>
109  NULL
110  ["USERTYPE"]=>
111  string(1) "1"
112}
113array(20) {
114  ["TYPE_NAME"]=>
115  string(7) "numeric"
116  ["DATA_TYPE"]=>
117  string(1) "2"
118  ["COLUMN_SIZE"]=>
119  string(2) "38"
120  ["LITERAL_PREFIX"]=>
121  NULL
122  ["LITERAL_SUFFIX"]=>
123  NULL
124  ["CREATE_PARAMS"]=>
125  string(15) "precision,scale"
126  ["NULLABLE"]=>
127  string(1) "1"
128  ["CASE_SENSITIVE"]=>
129  string(1) "0"
130  ["SEARCHABLE"]=>
131  string(1) "2"
132  ["UNSIGNED_ATTRIBUTE"]=>
133  string(1) "0"
134  ["FIXED_PREC_SCALE"]=>
135  string(1) "0"
136  ["AUTO_UNIQUE_VALUE"]=>
137  string(1) "0"
138  ["LOCAL_TYPE_NAME"]=>
139  string(7) "numeric"
140  ["MINIMUM_SCALE"]=>
141  string(1) "0"
142  ["MAXIMUM_SCALE"]=>
143  string(2) "38"
144  ["SQL_DATA_TYPE"]=>
145  string(1) "2"
146  ["SQL_DATETIME_SUB"]=>
147  NULL
148  ["NUM_PREC_RADIX"]=>
149  string(2) "10"
150  ["INTERVAL_PRECISION"]=>
151  NULL
152  ["USERTYPE"]=>
153  string(2) "10"
154}
155