Table 4-6 shows valid data conversions for input variables. A bullet indicates that conversion is possible; an "X" indicates that conversion is required. Errors, including truncation, can result if you choose nonconvertible host variable datatypes.
From: C datatype |
To: Adaptive Server Enterprise datatype |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tinyint |
bit |
smallint |
usmallint |
int |
uint |
bigint |
ubigint |
float |
char |
unichar |
money |
date |
time |
datetime |
decimal |
numeric |
text |
xml |
|
unsigned char |
• |
• |
• |
• |
• |
• |
• |
• |
• |
X |
X |
• |
• |
• |
• |
• |
|||
unichar |
• |
• |
• |
• |
• |
• |
• |
• |
• |
X |
X |
• |
• |
• |
• |
• |
|||
short int |
• |
• |
• |
• |
• |
• |
• |
• |
• |
X |
X |
• |
• |
• |
• |
• |
|||
long int |
• |
• |
• |
• |
• |
• |
• |
• |
• |
X |
X |
• |
• |
• |
• |
• |
|||
bigint |
• |
• |
• |
• |
• |
• |
• |
• |
• |
X |
X |
• |
• |
• |
• |
• |
|||
ubigint |
• |
• |
• |
• |
• |
• |
• |
• |
• |
X |
X |
• |
• |
• |
• |
• |
|||
uint |
• |
• |
• |
• |
• |
• |
• |
• |
• |
X |
X |
• |
• |
• |
• |
• |
|||
usmallint |
• |
• |
• |
• |
• |
• |
• |
• |
• |
X |
X |
• |
• |
• |
• |
• |
|||
double float |
• |
• |
• |
• |
• |
• |
• |
• |
• |
X |
X |
• |
• |
• |
• |
• |
|||
char |
X |
X |
X |
X |
X |
X |
X |
X |
X |
• |
• |
X |
• |
• |
• |
X |
X |
X |
X |
money |
• |
• |
• |
• |
• |
• |
• |
• |
• |
• |
• |
• |
• |
• |
• |
• |
|||
date |
• |
||||||||||||||||||
time |
• |
||||||||||||||||||
datetime |
X |
X |
• |
||||||||||||||||
text |
• |
• |
• |
• |
• |
• |
• |
• |
• |
X |
X |
• |
• |
• |
• |
• |
|||
xml |
• |
• |
• |
• |
• |
• |
• |
• |
• |
X |
X |
• |
• |
• |
• |
• |
|||
X – indicates that an explicit conversion is required. |