Support synthesized oblique and bold in SceneGraph
[profile/ivi/qtbase.git] / doc / src / sql / sql-programming / qsqldatatype-table.qdoc
1 /****************************************************************************
2 **
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 **
7 ** This file is part of the documentation of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:FDL$
10 ** GNU Free Documentation License
11 ** Alternatively, this file may be used under the terms of the GNU Free
12 ** Documentation License version 1.3 as published by the Free Software
13 ** Foundation and appearing in the file included in the packaging of
14 ** this file.
15 **
16 ** Other Usage
17 ** Alternatively, this file may be used in accordance with the terms
18 ** and conditions contained in a signed written agreement between you
19 ** and Nokia.
20 **
21 **
22 **
23 **
24 ** $QT_END_LICENSE$
25 **
26 ****************************************************************************/
27
28 /*!
29   \page sql-types.html
30   \title Data Types for Qt-supported Database Systems
31   \brief Recommended data types for database systems
32   
33   \ingroup qt-sql
34
35   \section1 Recommended Data Types for Qt-Supported Database Systems
36
37   This table shows the recommended data types for extracting data from
38   the databases supported in Qt. Note that types used in Qt are not
39   necessarily valid as input types to a specific database
40   system. e.g., A double might work perfectly as input for floating
41   point records in a particular database, but not necessarily as a
42   storage format for output from that database, because it would be
43   stored with 64-bit precision in C++.
44
45   \tableofcontents
46
47   \section2 IBM DB2 Data Types
48
49   \table 90%
50     \header
51         \o IBM DB2 data type
52         \o SQL type description
53         \o Recommended input (C++ or Qt data type)
54     \row
55         \o SMALLINT
56         \o 16-bit signed integer
57         \o typedef qint16
58     \row
59         \o INTEGER
60         \o 32-bit signed integer
61         \o typedef qint32
62     \row
63         \o BIGINT
64         \o 64-bit signed integer
65         \o typedef qint64
66     \row
67         \o REAL
68         \o 32-bit Single-precision floating point
69         \o By default mapping to QString
70     \row
71         \o DOUBLE PRECISION
72         \o 64-bit Double-precision floating point
73         \o By default mapping to QString
74     \row
75         \o FLOAT
76         \o 64-bit Double-precision floating point
77         \o By default mapping to QString
78     \row
79         \o CHAR
80         \o Fixed-length, null-terminated character string
81         \o Mapped to QString
82     \row
83         \o VARCHAR
84         \o Null-terminated varying length string
85         \o Mapped to QString
86     \row
87         \o LONG VARCHAR
88         \o Not null-terminated varying length character string
89         \o Mapped to QString
90     \row
91         \o BLOB
92         \o Not null-terminated varying binary string with 4-byte string 
93         length indicator
94         \o Mapped to QByteArray
95     \row
96         \o CLOB
97         \o Character large string object
98         \o Mapped to QString
99     \row
100         \o DATE
101         \o Null-terminated character string of the following format:
102         yyyy-mm-dd
103         \o Mapped to QDate
104     \row
105         \o TIME
106         \o Null-terminated character string of the following format: hh.mm.ss
107         \o Mapped to QTime
108     \row
109         \o TIMESTAMP
110         \o Null-terminated character string of the following format: yyyy-mm-dd-hh.mm.ss.nnnnnn
111         \o Mapped to QDateTime
112   \endtable
113
114   \section2 Borland InterBase Data Types
115
116   \table 90%
117     \header
118         \o Borland InterBase data type
119         \o SQL type description
120         \o Recommended input (C++ or Qt data type)
121     \row
122         \o BOOLEAN
123         \o Boolean
124         \o bool
125     \row
126         \o TINYINT
127         \o 8 bit signed integer
128         \o typedef qint8
129     \row
130         \o SMALLINT
131         \o 16-bit signed integer
132         \o typedef qint16
133     \row
134         \o INTEGER
135         \o 32-bit signed integer
136         \o typedef qint32
137     \row
138         \o BIGINT LONG
139         \o 64-bit signed integer
140         \o typedef qint64
141     \row
142         \o REAL FLOAT
143         \o 32-bit floating point
144         \o By default mapping to QString
145     \row
146         \o FLOAT
147         \o 64-bit floating point
148         \o By default mapping to QString
149     \row
150         \o DOUBLE
151         \o 64-bit floating point
152         \o By default mapping to QString
153     \row
154         \o DOUBLE PRECISION
155         \o 64-bit Double-precision floating point
156         \o By default mapping to QString
157     \row
158         \o VARCHAR STRING
159         \o Character string, Unicode
160         \o Mapped to QString
161     \row
162         \o CLOB
163         \o Character large string object
164         \o Mapped to QString
165     \row
166         \o DATE
167         \o Displays date. Format: 'yyyy-mm-dd'
168         \o Mapped to QDate
169     \row
170         \o TIME
171         \o Displays time. Format is 'hh:mm:ss' in 24-hour format
172         \o Mapped to QTime
173     \row
174         \o TIMESTAMP
175         \o Displays a timestamp. Format is 'yyyy-mm-dd hh:mm:ss'
176         \o Mapped to QDateTime
177   \endtable
178
179   \section2 MySQL Data Types
180
181   \table 90%
182     \header
183         \o MySQL data type
184         \o SQL type description
185         \o Recommended input (C++ or Qt data type)
186     \row
187         \o TINYINT
188         \o 8 bit signed integer
189         \o typedef qint8
190     \row
191         \o TINYINT UNSIGNED
192         \o 8 bit unsigned integer
193         \o typedef quint8
194     \row
195         \o SMALLINT
196         \o 16-bit signed integer
197         \o typedef qint16
198     \row
199         \o SMALLINT UNSIGNED
200         \o 16-bit unsigned integer
201         \o typedef quint16
202     \row
203         \o INT
204         \o 32-bit signed integer
205         \o typedef qint32
206     \row
207         \o INT UNSIGNED
208         \o 32-bit unsigned integer
209         \o typedef quint32
210     \row
211         \o BIGINT
212         \o 64-bit signed integer
213         \o typedef qint64
214     \row
215         \o FLOAT
216         \o 32-bit Floating Point
217         \o By default mapping to QString
218     \row
219         \o DOUBLE
220         \o 64-bit Floating Point
221         \o By default mapping to QString
222     \row
223         \o CHAR
224         \o Character string
225         \o Mapped to QString
226     \row
227         \o VARCHAR
228         \o Character string
229         \o Mapped to QString
230     \row
231         \o TINYTEXT
232         \o Character string
233         \o Mapped to QString
234     \row
235         \o TEXT
236         \o Character string
237         \o Mapped to QString
238     \row
239         \o MEDIUMTEXT
240         \o Character string
241         \o Mapped to QString
242     \row
243         \o LONGTEXT
244         \o Character string
245         \o Mapped to QString
246     \row
247         \o CLOB
248         \o Character large string object
249         \o Mapped to QString
250     \row
251         \o all BLOB types
252         \o BLOB
253         \o Mapped to QByteArray
254     \row
255         \o DATE
256         \o Date without Time
257         \o Mapped to QDate
258     \row
259         \o DATETIME
260         \o Date and Time
261         \o Mapped to QDateTime
262     \row
263         \o TIMESTAMP
264         \o Date and Time
265         \o Mapped to QDateTime
266     \row
267         \o TIME
268         \o Time
269         \o Mapped to QTime
270     \row
271         \o YEAR
272         \o Year (int)
273         \o Mapped to QDateTime
274     \row
275         \o ENUM
276         \o Enumeration of Value Set
277         \o Mapped to QString
278   \endtable
279
280   \section2 Oracle Call Interface Data Types
281
282   \table 90%
283     \header
284         \o Oracle Call Interface data type
285         \o SQL type description
286         \o Recommended input (C++ or Qt data type)
287     \row
288         \o NUMBER
289         \o FLOAT, DOUBLE, PRECISIONc REAL
290         \o By default mapping to QString
291     \row
292         \o NUMBER(38)
293         \o INTEGER INT SMALLINT
294         \o typedef qint8/16/32/64
295     \row
296         \o NUMBER(p,s)
297         \o NUMERIC(p,s) DECIMAL(p,s)a
298         \o By default mapping to QString
299     \row
300         \o NVARCHAR2(n)
301         \o Character string (NATIONAL CHARACTER VARYING(n) NATIONAL 
302         CHAR VARYING(n) NCHAR VARYING(n))
303         \o Mapped to QString
304     \row
305         \o NCHAR(n)
306         \o Character string (NATIONAL CHARACTER(n) NATIONAL CHAR(n) 
307         NCHAR(n))
308     \o Mapped to QString
309     \row
310         \o CHAR(n)
311         \o Character string (CHARACTER(n) CHAR(n))
312         \o Mapped to QString
313     \row
314         \o CLOB
315         \o Character large string object
316         \o Mapped to QString
317     \row
318         \o BLOB
319         \o A binary large object
320         \o Mapped to QByteArray
321     \row
322         \o TIMESTAMP
323         \o Year, month, and day values of date, as well as hour, minute,
324         and second values of time
325         \o Mapped to QDateTime
326   \endtable
327
328   \section2 ODBC Data Types
329
330   \table 90%
331     \header
332         \o ODBC data type
333         \o SQL type description
334         \o Recommended input (C++ or Qt data type)
335     \row
336         \o BIT
337         \o Boolean
338         \o BOOL
339     \row
340         \o TINYINT
341         \o 8 bit integer
342         \o typedef qint8
343     \row
344         \o SMALLINT
345         \o 16-bit signed integer
346         \o typedef qint16
347     \row
348         \o INTEGER
349         \o 32-bit signed integer
350         \o typedef qint32
351     \row
352         \o BIGINT
353         \o 64-bit signed integer
354         \o typedef qint64
355     \row
356         \o REAL
357         \o 32-bit Single-precision floating point
358         \o By default mapping to QString
359     \row
360         \o FLOAT
361         \o 64-bit Double floating point
362         \o By default mapping to QString
363     \row
364         \o DOUBLE
365         \o 64-bit Double floating point
366         \o By default mapping to QString
367     \row
368         \o CHAR
369         \o Character string
370         \o Mapped to QString
371     \row
372         \o VARCHAR
373         \o Character string
374         \o Mapped to QString
375     \row
376         \o LONGVARCHAR
377         \o Character string
378         \o Mapped to QString
379     \row
380         \o CLOB
381         \o Character large string object
382         \o Mapped to QString
383     \row
384         \o DATE
385         \o Character string
386         \o Mapped to QDate
387     \row
388         \o TIME
389         \o Character Time, Character string
390         \o Mapped to QTime
391     \row
392         \o TIMESTAMP
393         \o Character Time, Character string
394         \o Mapped to QDateTime
395   \endtable
396
397   \section2 PostgreSQL Data Types
398
399   \table 90%
400     \header
401         \o PostgreSQL data type
402         \o SQL type description
403         \o Recommended input (C++ or Qt data type)
404     \row
405         \o BOOLEAN
406         \o Boolean
407         \o bool
408     \row
409         \o SMALLINT
410         \o 16-bit signed integer
411         \o typedef qint16
412     \row
413         \o INTEGER
414         \o 32-bit signed integer
415         \o typedef qint32
416     \row
417         \o BIGINT
418         \o 64-bit signed integer
419         \o typedef qint64
420     \row
421         \o REAL
422         \o 32-bit variable-precision floating point
423         \o By default mapping to QString
424     \row
425         \o DOUBLE PRECISION
426         \o 64-bit variable-precision floating point
427         \o By default mapping to QString
428     \row
429         \o DECIMAL VARIABLE
430         \o user-specified precision, exact
431         \o Mapped to QString
432     \row
433         \o NUMERIC VARIABLE
434         \o user-specified precision, exact
435         \o Mapped to QString
436     \row
437         \o VARCHAR
438         \o variable-length character string
439         \o Mapped to QString
440     \row
441         \o CHARACTER
442         \o Character string of fixed-length
443         \o Mapped to QString
444     \row
445         \o TEXT
446         \o Character string of variable-length
447         \o Mapped to QString
448     \row
449         \o CLOB
450         \o Character large string object
451         \o Mapped to QString
452     \row
453         \o TIMESTAMP
454         \o 8 bytes, both date and time
455         \o Mapped to QDateTime
456     \row
457         \o TIMESTAMP
458         \o 8 bytes, both date and time, with time zone
459         \o Mapped to QDateTime
460     \row
461         \o DATE
462         \o 4 bytes, dates only
463         \o Mapped to QDate
464     \row
465         \o TIME
466         \o 8 bytes, times of day only 00:00:00.00 - 23:59:59.99
467         \o Mapped to QTime
468     \row
469         \o TIME
470         \o 12 bytes times of day only, with time zone 00:00:00.00+12
471         \o Mapped to QDateTime
472   \endtable
473
474   \section2 QSQLITE SQLite version 3 Data Types
475
476   \table 90%
477     \header
478         \o QSQLITE SQLite version 3 data type
479         \o SQL type description
480         \o Recommended input (C++ or Qt data type)
481     \row
482         \o NULL
483         \o NULL value.
484         \o NULL
485     \row
486         \o INTEGER
487         \o Signed integer, stored in 8, 16, 24, 32, 48, or 64-bits 
488         depending on the magnitude of the value.
489         \o typedef qint8/16/32/64
490     \row
491         \o REAL
492         \o 64-bit floating point value.
493         \o By default mapping to QString
494     \row
495         \o TEXT
496         \o Character string (UTF-8, UTF-16BE or UTF-16-LE).
497         \o Mapped to QString
498     \row
499         \o CLOB
500         \o Character large string object
501         \o Mapped to QString
502     \row
503         \o BLOB
504         \o The value is a BLOB of data, stored exactly as it was input.
505         \o Mapped to QByteArray
506   \endtable
507
508   \section2 Sybase Adaptive Server Data Types
509
510   \table 90%
511     \header
512         \o Sybase Adaptive Server data type
513         \o SQL type description
514         \o Recommended input (C++ or Qt data type)
515     \row
516         \o BINARY
517         \o Describes a fixed-length binary value up to 255 bytes in size.
518         \o Mapped to QByteArray
519     \row
520         \o CHAR
521         \o Character String
522         \o Mapped to QString
523     \row
524         \o DATETIME
525         \o Date and time. Range: 1753-01-01 00:00:00 through 9999-12-31 23:59:59.
526         \o Mapped to QDateTime
527     \row
528         \o NCHAR
529         \o Character String of fixed length
530         \o Mapped to QString
531     \row
532         \o NVARACHAR
533         \o Character String of variable length
534         \o Mapped to QString
535     \row
536         \o VARCHAR
537         \o Character String of fixed length
538         \o Mapped to QString
539     \row
540         \o CLOB
541         \o Character large string object
542         \o Mapped to QString
543     \row
544         \o TIMESTAMP
545         \o A unique number within a database
546         \o Mapped to QString
547     \row
548         \o SMALLDATETIME
549         \o Date and time. Range: 1900-01-01 00:00 through 2079-12-31 23:59
550         \o Mapped to QDateTime
551     \row
552         \o UNICHAR
553         \o Character String of fixed length.(Unicode)
554         \o Mapped to QString
555     \row
556         \o UNIVARCHAR
557         \o Character String of variable length.(Unicode)
558         \o Mapped to QString
559     \row
560         \o VARBINARY
561         \o Describes a variable-length binary value up to 255 bytes in size
562         \o Mapped to QByteArray 
563   \endtable
564
565   \section2 SQLite Version 2
566
567   SQLite version 2 is "typeless". This means that you can store any kind of
568   data you want in any column of any table, regardless of the declared
569   data type of that column. We recommend that you map the data to QString.
570 */