Datatypes
The classes RWDBColumn and RWDBValue have an associated RWDBValue::ValueType that specifies the datatype of the database column or field being referenced. Mapping between this datatype and the database vendor type runs in both directions:
*When fetching data or retrieving information about tables, the DB Access Module for MySQL converts the MySQL type value into RWDBValue::ValueTypes. This mapping is shown in Table 1, which also gives the C++ datatype corresponding to the RWDBValue::ValueType.
*When creating tables, the DB Access Module for MySQL maps the given RWDBValue::ValueType into a MySQL datatype. This mapping is shown in Table 2.
The RWDBValue::ValueType, accessible through the type() method, is uniform across all Access Modules. For a complete explanation of the DB Interface Module data model, see Chapter 7, "The Data Model," in the DB Interface Module User’s Guide, and RWDBValue in the SourcePro API Reference Guide..
Table 1 – Type mapping when retrieving data 
MySQL Datatype
RWDBValue::ValueType
C++ Datatype
decimal, numeric
Decimal
bigint
UnsignedLongLong, LongLong
unsigned long long, long long
tinyblob, blob, mediumblob, longblob
Blob
double
Double
double
float
Float
float
tinyint
Char, UnsignedChar
char, unsigned char
smallint
Short, UnsignedShort
short, unsigned short
integer, mediumint
Long, UnsignedLong
long, unsigned long
char, varchar, tinytext, mediumtext, text, longtext, enum, set
String
date1
Date
datetime1
time1
timestamp2
DateTime
year
UnsignedShort
unsigned short

1 Any illegal RWDateTime value that is inserted into a TIME column is converted to “00:00:00” by the database. (MySQL converts all illegal TIME values to “00:00:00”.) Refer to your MySQL server settings to determine if the server will report this conversion as an error.

2 Values of type datetime, time, and timestamp are affected by the time zone setting on either RWDBDatabase or RWDBConnection when sending and retrieving data. The time zone setting can be set programmatically with the timeZone() method in each of these classes.

Table 2 – Type mapping when creating tables 
RWDBValue::ValueType
MySQL Datatypes
Blob
MEDIUMBLOB if length is RWDB_NO_TRAIT. If 0<= length <= 255 TINYBLOB. If 256 <= length <=65,535 BLOB. If 65,536 <= length <= 16,777,215 MEDIUMBLOB. Otherwise, LONGBLOB.
Tiny, UnsignedTiny, Char, UnsignedChar
TINYINT
Date
DATE
DateTime
DATETIME
Decimal (p,s)
DECIMAL using precision and scale of column. If p <= 0 defaults to 8. If s <= 0 defaults to 0.
Double
DOUBLE
Float (P)
FLOAT if precision is RWDB_NO_TRAIT. Otherwise, FLOAT (p) using precision of column.
Int, UnsignedInt, Long, UnsignedLong
INT
Short, UnsignedShort
SMALLINT
LongLong, UnsignedLongLong
BIGINT
String
MEDIUMTEXT if length is RWDB_NO_TRAIT. If 0<= length <= 255 VARCHAR(length) using the storageLength of the RWDBColumn. If 256 <= length <= 65,535 TEXT. If 65,536 <= length <= 16,777,215 MEDIUMTEXT. Otherwise LONGTEXT.