CopperSpice API  1.9.1
Data Types

Recommended Data Types for CopperSpice Supported Database Systems

These tables show the recommended data types for extracting data from the databases supported in CopperSpice. Types used in CopperSpice are not necessarily valid as input types to a specific database system. For example, a double might work perfectly as input for floating point records in a particular database, but not necessarily as a storage format for output from that database, because it would be stored with 64-bit precision in C++.

IBM DB2 Data Types

SQL TypeSQL Type DescriptionRecommended Type
SMALLINT16-bit signed integertypedef qint16
INTEGER32-bit signed integertypedef qint32
BIGINT64-bit signed integertypedef qint64
REAL32-bit Single-precision floating pointMapped to QString
DOUBLE PRECISION64-bit Double-precision floating pointMapped to QString
FLOAT64-bit Double-precision floating pointMapped to QString
CHARFixed-length, null-terminated character stringMapped to QString
VARCHARNull-terminated varying length stringMapped to QString
LONG VARCHARNot null-terminated varying length character stringMapped to QString
BLOBNot null-terminated varying binary string with 4-byte string length indicatorMapped to QByteArray
CLOBCharacter large string objectMapped to QString
DATENull-terminated character string of the following format: yyyy-mm-ddMapped to QDate
TIMENull-terminated character string of the following format: hh.mm.ssMapped to QTime
TIMESTAMPNull-terminated character string of the following format: yyyy-mm-dd-hh.mm.ss.nnnnnnMapped to QDateTime

Borland InterBase Data Types

SQL TypeSQL Type DescriptionRecommended Type
BOOLEANBooleanbool
TINYINT8 bit signed integertypedef qint8
SMALLINT16-bit signed integertypedef qint16
INTEGER32-bit signed integertypedef qint32
BIGINT LONG64-bit signed integertypedef qint64
REAL FLOAT32-bit floating pointMapped to QString
FLOAT64-bit floating pointMapped to QString
DOUBLE64-bit floating pointMapped to QString
DOUBLE PRECISION64-bit Double-precision floating pointMapped to QString
VARCHAR STRINGCharacter string, UnicodeMapped to QString
CLOBCharacter large string objectMapped to QString
DATEDisplays date. Format: 'yyyy-mm-dd'Mapped to QDate
TIMEDisplays time. Format is 'hh:mm:ss' in 24-hour formatMapped to QTime
TIMESTAMPDisplays a timestamp. Format is 'yyyy-mm-dd hh:mm:ss'Mapped to QDateTime

MySQL Data Types

SQL TypeSQL Type DescriptionRecommended Type
TINYINT8 bit signed integertypedef qint8
TINYINT UNSIGNED8 bit unsigned integertypedef quint8
SMALLINT16-bit signed integertypedef qint16
SMALLINT UNSIGNED16-bit unsigned integertypedef quint16
INT32-bit signed integertypedef qint32
INT UNSIGNED32-bit unsigned integertypedef quint32
BIGINT64-bit signed integertypedef qint64
FLOAT32-bit Floating PointMapped to QString
DOUBLE64-bit Floating PointMapped to QString
CHARCharacter stringMapped to QString
VARCHARCharacter stringMapped to QString
TINYTEXTCharacter stringMapped to QString
TEXTCharacter stringMapped to QString
MEDIUMTEXTCharacter stringMapped to QString
LONGTEXTCharacter stringMapped to QString
CLOBCharacter large string objectMapped to QString
all BLOB typesBLOBMapped to QByteArray
DATEDate without TimeMapped to QDate
DATETIMEDate and TimeMapped to QDateTime
TIMESTAMPDate and TimeMapped to QDateTime
TIMETimeMapped to QTime
YEARYear (int)Mapped to QDateTime
ENUMEnumeration of Value SetMapped to QString

Oracle Call Interface Data Types

SQL TypeSQL Type DescriptionRecommended Type
NUMBERFLOAT, DOUBLE, PRECISIONc REALMapped to QString
NUMBER(38)INTEGER INT SMALLINTMapped to qint8, qint16,
qint32, qint64
NUMBER(p,s)NUMERIC(p,s) DECIMAL(p,s)aMapped to QString
NVARCHAR2(n)Character string (NATIONAL CHARACTER VARYING(n) NATIONAL CHAR VARYING(n) NCHAR VARYING(n))Mapped to QString
NCHAR(n)Character string (NATIONAL CHARACTER(n) NATIONAL CHAR(n) NCHAR(n))Mapped to QString
CHAR(n)Character string (CHARACTER(n) CHAR(n))Mapped to QString
CLOBCharacter large string objectMapped to QString
BLOBA binary large objectMapped to QByteArray
TIMESTAMPYear, month, and day values of date, as well as hour, minute, and second values of timeMapped to QDateTime

ODBC Data Types

SQL TypeSQL Type DescriptionRecommended Type
BITBooleanBOOL
TINYINT8 bit integertypedef qint8
SMALLINT16-bit signed integertypedef qint16
INTEGER32-bit signed integertypedef qint32
BIGINT64-bit signed integertypedef qint64
REAL32-bit Single-precision floating pointMapped to QString
FLOAT64-bit Double floating pointMapped to QString
DOUBLE64-bit Double floating pointMapped to QString
CHARCharacter stringMapped to QString
VARCHARCharacter stringMapped to QString
LONGVARCHARCharacter stringMapped to QString
CLOBCharacter large string objectMapped to QString
DATECharacter stringMapped to QDate
TIMECharacter Time, Character stringMapped to QTime
TIMESTAMPCharacter Time, Character stringMapped to QDateTime

PostgreSQL Data Types

SQL TypeSQL Type DescriptionRecommended Type
BOOLEANBooleanbool
SMALLINT16-bit signed integertypedef qint16
INTEGER32-bit signed integertypedef qint32
BIGINT64-bit signed integertypedef qint64
REAL32-bit variable-precision floating pointMapped to QString
DOUBLE PRECISION64-bit variable-precision floating pointMapped to QString
DECIMAL VARIABLEuser-specified precision, exactMapped to QString
NUMERIC VARIABLEuser-specified precision, exactMapped to QString
VARCHARvariable-length character stringMapped to QString
CHARACTERCharacter string of fixed-lengthMapped to QString
TEXTCharacter string of variable-lengthMapped to QString
CLOBCharacter large string objectMapped to QString
TIMESTAMP8 bytes, both date and timeMapped to QDateTime
TIMESTAMP8 bytes, both date and time, with time zoneMapped to QDateTime
DATE4 bytes, dates onlyMapped to QDate
TIME8 bytes, times of day only 00:00:00.00 - 23:59:59.99Mapped to QTime
TIME12 bytes times of day only, with time zone 00:00:00.00+12Mapped to QDateTime

QSQLITE SQLite version 3 Data Types

SQL TypeSQL Type DescriptionRecommended Type
NULLNULL value.NULL
INTEGERSigned integer, stored in 8, 16, 24, 32, 48, or 64-bits depending on the magnitude of the value. Mapped to qint8, qint16,
qint32, qint64
REAL64-bit floating point value.Mapped to QString
TEXTCharacter string (UTF-8, UTF-16BE or UTF-16LE).Mapped to QString
CLOBCharacter large string objectMapped to QString
BLOBThe value is a BLOB of data, stored exactly as it was input.Mapped to QByteArray