1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
6 \title Data Types for Qt-supported Database Systems
7 \brief Recommended data types for database systems
9 \section1 Recommended Data Types for Qt-Supported Database Systems
11 This table shows the recommended data types for extracting data from
12 the databases supported in Qt. Note that types used in Qt are not
13 necessarily valid as input types to a specific database
14 system. e.g., A double might work perfectly as input for floating
15 point records in a particular database, but not necessarily as a
16 storage format for output from that database, because it would be
17 stored with 64-bit precision in C++.
21 \section2 IBM DB2 Data Types
26 \li SQL type description
27 \li Recommended input (C++ or Qt data type)
30 \li 16-bit signed integer
34 \li 32-bit signed integer
38 \li 64-bit signed integer
42 \li 32-bit Single-precision floating point
46 \li 64-bit Double-precision floating point
47 \li Mapped to QString for high precision doubles, otherwise qreal
50 \li 64-bit Double-precision floating point
54 \li Fixed-length, null-terminated character string
58 \li Null-terminated varying length string
62 \li Not null-terminated varying length character string
66 \li Not null-terminated varying binary string with 4-byte string
68 \li Mapped to QByteArray
71 \li Character large string object
75 \li Null-terminated character string of the following format:
80 \li Null-terminated character string of the following format: hh.mm.ss
84 \li Null-terminated character string of the following format: yyyy-mm-dd-hh.mm.ss.nnnnnn
85 \li Mapped to QDateTime
88 \section2 Borland InterBase Data Types
92 \li Borland InterBase data type
93 \li SQL type description
94 \li Recommended input (C++ or Qt data type)
101 \li 8 bit signed integer
105 \li 16-bit signed integer
109 \li 32-bit signed integer
113 \li 64-bit signed integer
117 \li 32-bit floating point
121 \li 64-bit floating point
125 \li 64-bit floating point
129 \li 64-bit Double-precision floating point
130 \li Mapped to QString for high precision doubles, otherwise qreal
133 \li Character string, Unicode
134 \li Mapped to QString
137 \li Character large string object
138 \li Mapped to QString
141 \li Displays date. Format: 'yyyy-mm-dd'
145 \li Displays time. Format is 'hh:mm:ss' in 24-hour format
149 \li Displays a timestamp. Format is 'yyyy-mm-dd hh:mm:ss'
150 \li Mapped to QDateTime
153 \section2 MySQL Data Types
158 \li SQL type description
159 \li Recommended input (C++ or Qt data type)
162 \li 8 bit signed integer
166 \li 8 bit unsigned integer
170 \li 16-bit signed integer
173 \li SMALLINT UNSIGNED
174 \li 16-bit unsigned integer
178 \li 32-bit signed integer
182 \li 32-bit unsigned integer
186 \li 64-bit signed integer
190 \li 32-bit Floating Point
194 \li 64-bit Floating Point
195 \li Mapped to QString for high precision doubles, otherwise qreal
199 \li Mapped to QString
203 \li Mapped to QString
207 \li Mapped to QString
211 \li Mapped to QString
215 \li Mapped to QString
219 \li Mapped to QString
222 \li Character large string object
223 \li Mapped to QString
227 \li Mapped to QByteArray
230 \li Date without Time
235 \li Mapped to QDateTime
239 \li Mapped to QDateTime
247 \li Mapped to QDateTime
250 \li Enumeration of Value Set
251 \li Mapped to QString
254 \section2 Oracle Call Interface Data Types
258 \li Oracle Call Interface data type
259 \li SQL type description
260 \li Recommended input (C++ or Qt data type)
263 \li FLOAT, DOUBLE, PRECISIONc REAL
264 \li Mapped to QString for high precision doubles, otherwise qreal
267 \li INTEGER INT SMALLINT
268 \li typedef qint8/16/32/64
271 \li NUMERIC(p,s) DECIMAL(p,s)a
272 \li Mapped to QString
275 \li Character string (NATIONAL CHARACTER VARYING(n) NATIONAL
276 CHAR VARYING(n) NCHAR VARYING(n))
277 \li Mapped to QString
280 \li Character string (NATIONAL CHARACTER(n) NATIONAL CHAR(n)
282 \li Mapped to QString
285 \li Character string (CHARACTER(n) CHAR(n))
286 \li Mapped to QString
289 \li Character large string object
290 \li Mapped to QString
293 \li A binary large object
294 \li Mapped to QByteArray
297 \li Year, month, and day values of date, as well as hour, minute,
298 and second values of time
299 \li Mapped to QDateTime
302 \section2 ODBC Data Types
307 \li SQL type description
308 \li Recommended input (C++ or Qt data type)
319 \li 16-bit signed integer
323 \li 32-bit signed integer
327 \li 64-bit signed integer
331 \li 32-bit Single-precision floating point
335 \li 64-bit Double floating point
339 \li 64-bit Double floating point
340 \li Mapped to QString for high precision doubles, otherwise qreal
344 \li Mapped to QString
348 \li Mapped to QString
352 \li Mapped to QString
355 \li Character large string object
356 \li Mapped to QString
363 \li Character Time, Character string
367 \li Character Time, Character string
368 \li Mapped to QDateTime
371 \section2 PostgreSQL Data Types
375 \li PostgreSQL data type
376 \li SQL type description
377 \li Recommended input (C++ or Qt data type)
384 \li 16-bit signed integer
388 \li 32-bit signed integer
392 \li 64-bit signed integer
396 \li 32-bit variable-precision floating point
400 \li 64-bit variable-precision floating point
401 \li Mapped to QString for high precision doubles, otherwise qreal
404 \li user-specified precision, exact
408 \li user-specified precision, exact
412 \li variable-length character string
413 \li Mapped to QString
416 \li Character string of fixed-length
417 \li Mapped to QString
420 \li Character string of variable-length
421 \li Mapped to QString
424 \li Character large string object
425 \li Mapped to QString
428 \li 8 bytes, both date and time
429 \li Mapped to QDateTime
432 \li 8 bytes, both date and time, with time zone
433 \li Mapped to QDateTime
436 \li 4 bytes, dates only
440 \li 8 bytes, times of day only 00:00:00.00 - 23:59:59.99
444 \li 12 bytes times of day only, with time zone 00:00:00.00+12
445 \li Mapped to QDateTime
448 \section2 QSQLITE SQLite version 3 Data Types
452 \li QSQLITE SQLite version 3 data type
453 \li SQL type description
454 \li Recommended input (C++ or Qt data type)
461 \li Signed integer, stored in 8, 16, 24, 32, 48, or 64-bits
462 depending on the magnitude of the value.
463 \li typedef qint8/16/32/64
466 \li 64-bit floating point value.
470 \li Character string (UTF-8, UTF-16BE or UTF-16-LE).
471 \li Mapped to QString
474 \li Character large string object
475 \li Mapped to QString
478 \li The value is a BLOB of data, stored exactly as it was input.
479 \li Mapped to QByteArray
482 \section2 Mimer SQL Data Types
487 \li SQL type description
488 \li Recommended input (C++ or Qt data type)
491 \li 16-bit signed integer
495 \li 32-bit signed integer
499 \li Integer with up to 45 digits precision
500 \li Mapped to QString
503 \li 64-bit signed integer
507 \li 32-bit Single-precision IEEE floating point
511 \li 64-bit Double-precision IEEE floating point
512 \li Mapped to QString for high precision doubles, otherwise qreal
515 \li 64-bit Double-precision IEEE floating point
516 \li Mapped to QString for high precision doubles, otherwise qreal
519 \li Floating point with up to 45 digits precision
520 \li Mapped to QString
523 \li Decimal with up to 45 digits precision and scale
524 \li Mapped to QString
527 \li Fixed-length character Latin-1 string (CHAR or character)
528 \li Mapped to QString
531 \li Variable length Latin-1 string (VARCHAR or CHARACTER VARYING)
532 \li Mapped to QString
535 \li Fixed-length Unicode string (NCHAR or NATIONAL CHARACTER)
536 \li Mapped to QString
539 \li Variable length Unicode string (NVARCHAR or NATIONAL CHARACTER VARYING)
540 \li Mapped to QString
543 \li Fixed length binary data
544 \li Mapped to QByteArray
547 \li Variable length binary data (VARBINARY or BINARY VARYING)
548 \li Mapped to QByteArray
551 \li Binary large object (BLOB or BINARY LARGE OBJECT)
552 \li Mapped to QByteArray
555 \li Latin-1 character large object (CLOB or CHARACTER LARGE OBJECT)
556 \li Mapped to QString
559 \li Unicode character large object (NCLOB or NATIONAL CHARACTER LARGE OBJECT)
560 \li Mapped to QString
563 \li Date consisting of year, month, and day
567 \li Time consisting of hours, minute, seconds with optional fractional seconds
571 \li Date and time with optional fractional seconds
572 \li Mapped to QDateTime
575 \li Universally unique identifier
583 \li Year, format '±yyyyyyy' (max precision)
584 \li Mapped to QString
586 \li INTERVAL YEAR(7) TO MONTH
587 \li Year to month, format '±yyyyyyy-mm' (max precision)
588 \li Mapped to QString
590 \li INTERVAL MONTH(7)
591 \li Month, format '±mmmmmmm' (max precision)
592 \li Mapped to QString
595 \li Day, format '±ddddddd' (max precision)
596 \li Mapped to QString
598 \li INTERVAL DAY(7) TO HOUR
599 \li Day to hour, format '±ddddddd hh' (max precision)
600 \li Mapped to QString
602 \li INTERVAL DAY(7) TO MINUTE
603 \li Day to minute, format '±ddddddd hh:mm' (max precision)
604 \li Mapped to QString
606 \li INTERVAL DAY(7) TO SECOND(9)
607 \li Day to second, format '±ddddddd hh:mm:ss[.fffffffff]' (max precision)
608 \li Mapped to QString
611 \li Hour, format '±hhhhhhhh' (max precision)
612 \li Mapped to QString
614 \li INTERVAL HOUR(8) TO MINUTE
615 \li Hour to minute, format '±hhhhhhhh:mm' (max precision)
616 \li Mapped to QString
618 \li INTERVAL HOUR(8) TO SECOND(9)
619 \li Hour to second, format '±hhhhhhhh:mm:ss[.fffffffff]' (max precision)
620 \li Mapped to QString
622 \li INTERVAL MINUTE(10)
623 \li Minute, format '±mmmmmmmmmm' (max precision)
624 \li Mapped to QString
626 \li INTERVAL MINUTE(10) TO SECOND(9)
627 \li Minute to second, format '±mmmmmmmmmm:ss[.fffffffff]' (max precision)
628 \li Mapped to QString
630 \li INTERVAL SECOND(12,9)
631 \li Second, format '±ssssssssssss[.fffffffff]' (max precision)
632 \li Mapped to QString