1 /****************************************************************************
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the documentation of the Qt Toolkit.
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
17 ** Alternatively, this file may be used in accordance with the terms
18 ** and conditions contained in a signed written agreement between you
26 ****************************************************************************/
30 \title Data Types for Qt-supported Database Systems
31 \brief Recommended data types for database systems
35 \section1 Recommended Data Types for Qt-Supported Database Systems
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++.
47 \section2 IBM DB2 Data Types
52 \o SQL type description
53 \o Recommended input (C++ or Qt data type)
56 \o 16-bit signed integer
60 \o 32-bit signed integer
64 \o 64-bit signed integer
68 \o 32-bit Single-precision floating point
69 \o By default mapping to QString
72 \o 64-bit Double-precision floating point
73 \o By default mapping to QString
76 \o 64-bit Double-precision floating point
77 \o By default mapping to QString
80 \o Fixed-length, null-terminated character string
84 \o Null-terminated varying length string
88 \o Not null-terminated varying length character string
92 \o Not null-terminated varying binary string with 4-byte string
94 \o Mapped to QByteArray
97 \o Character large string object
101 \o Null-terminated character string of the following format:
106 \o Null-terminated character string of the following format: hh.mm.ss
110 \o Null-terminated character string of the following format: yyyy-mm-dd-hh.mm.ss.nnnnnn
111 \o Mapped to QDateTime
114 \section2 Borland InterBase Data Types
118 \o Borland InterBase data type
119 \o SQL type description
120 \o Recommended input (C++ or Qt data type)
127 \o 8 bit signed integer
131 \o 16-bit signed integer
135 \o 32-bit signed integer
139 \o 64-bit signed integer
143 \o 32-bit floating point
144 \o By default mapping to QString
147 \o 64-bit floating point
148 \o By default mapping to QString
151 \o 64-bit floating point
152 \o By default mapping to QString
155 \o 64-bit Double-precision floating point
156 \o By default mapping to QString
159 \o Character string, Unicode
163 \o Character large string object
167 \o Displays date. Format: 'yyyy-mm-dd'
171 \o Displays time. Format is 'hh:mm:ss' in 24-hour format
175 \o Displays a timestamp. Format is 'yyyy-mm-dd hh:mm:ss'
176 \o Mapped to QDateTime
179 \section2 MySQL Data Types
184 \o SQL type description
185 \o Recommended input (C++ or Qt data type)
188 \o 8 bit signed integer
192 \o 8 bit unsigned integer
196 \o 16-bit signed integer
200 \o 16-bit unsigned integer
204 \o 32-bit signed integer
208 \o 32-bit unsigned integer
212 \o 64-bit signed integer
216 \o 32-bit Floating Point
217 \o By default mapping to QString
220 \o 64-bit Floating Point
221 \o By default mapping to QString
248 \o Character large string object
253 \o Mapped to QByteArray
261 \o Mapped to QDateTime
265 \o Mapped to QDateTime
273 \o Mapped to QDateTime
276 \o Enumeration of Value Set
280 \section2 Oracle Call Interface Data Types
284 \o Oracle Call Interface data type
285 \o SQL type description
286 \o Recommended input (C++ or Qt data type)
289 \o FLOAT, DOUBLE, PRECISIONc REAL
290 \o By default mapping to QString
293 \o INTEGER INT SMALLINT
294 \o typedef qint8/16/32/64
297 \o NUMERIC(p,s) DECIMAL(p,s)a
298 \o By default mapping to QString
301 \o Character string (NATIONAL CHARACTER VARYING(n) NATIONAL
302 CHAR VARYING(n) NCHAR VARYING(n))
306 \o Character string (NATIONAL CHARACTER(n) NATIONAL CHAR(n)
311 \o Character string (CHARACTER(n) CHAR(n))
315 \o Character large string object
319 \o A binary large object
320 \o Mapped to QByteArray
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
328 \section2 ODBC Data Types
333 \o SQL type description
334 \o Recommended input (C++ or Qt data type)
345 \o 16-bit signed integer
349 \o 32-bit signed integer
353 \o 64-bit signed integer
357 \o 32-bit Single-precision floating point
358 \o By default mapping to QString
361 \o 64-bit Double floating point
362 \o By default mapping to QString
365 \o 64-bit Double floating point
366 \o By default mapping to QString
381 \o Character large string object
389 \o Character Time, Character string
393 \o Character Time, Character string
394 \o Mapped to QDateTime
397 \section2 PostgreSQL Data Types
401 \o PostgreSQL data type
402 \o SQL type description
403 \o Recommended input (C++ or Qt data type)
410 \o 16-bit signed integer
414 \o 32-bit signed integer
418 \o 64-bit signed integer
422 \o 32-bit variable-precision floating point
423 \o By default mapping to QString
426 \o 64-bit variable-precision floating point
427 \o By default mapping to QString
430 \o user-specified precision, exact
434 \o user-specified precision, exact
438 \o variable-length character string
442 \o Character string of fixed-length
446 \o Character string of variable-length
450 \o Character large string object
454 \o 8 bytes, both date and time
455 \o Mapped to QDateTime
458 \o 8 bytes, both date and time, with time zone
459 \o Mapped to QDateTime
462 \o 4 bytes, dates only
466 \o 8 bytes, times of day only 00:00:00.00 - 23:59:59.99
470 \o 12 bytes times of day only, with time zone 00:00:00.00+12
471 \o Mapped to QDateTime
474 \section2 QSQLITE SQLite version 3 Data Types
478 \o QSQLITE SQLite version 3 data type
479 \o SQL type description
480 \o Recommended input (C++ or Qt data type)
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
492 \o 64-bit floating point value.
493 \o By default mapping to QString
496 \o Character string (UTF-8, UTF-16BE or UTF-16-LE).
500 \o Character large string object
504 \o The value is a BLOB of data, stored exactly as it was input.
505 \o Mapped to QByteArray
508 \section2 Sybase Adaptive Server Data Types
512 \o Sybase Adaptive Server data type
513 \o SQL type description
514 \o Recommended input (C++ or Qt data type)
517 \o Describes a fixed-length binary value up to 255 bytes in size.
518 \o Mapped to QByteArray
525 \o Date and time. Range: 1753-01-01 00:00:00 through 9999-12-31 23:59:59.
526 \o Mapped to QDateTime
529 \o Character String of fixed length
533 \o Character String of variable length
537 \o Character String of fixed length
541 \o Character large string object
545 \o A unique number within a database
549 \o Date and time. Range: 1900-01-01 00:00 through 2079-12-31 23:59
550 \o Mapped to QDateTime
553 \o Character String of fixed length.(Unicode)
557 \o Character String of variable length.(Unicode)
561 \o Describes a variable-length binary value up to 255 bytes in size
562 \o Mapped to QByteArray
565 \section2 SQLite Version 2
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.