SAP AG
November 2002
Supported Data Types
The ODBC interface differentiates between the data types made available by the database
system (SQL data types) and the data types used in the ODBC application (C data types).
SQL Data Types [Page
6
]
C Data Types [Page
6
]
SQL Data Types
Every database system defines its own SQL data types. An ODBC driver processes only
those data types that are defined by the associated database system.
You can use the function
SQLGetTypeInfo
to determine how an ODBC driver maps the SQL
data types of the database system to the ODBC supported data types and to its own driver-
specific data types, as well as the specifications for length, decimal places (scale), and the
number of valid digits (precision).
For more information about the data types defined for the SAP DB database system, see the
Reference Manual: SAP DB 7.4
,
data type [See SAP DB Library]
section.
SAP DB data types that are supported by the SAP DB ODBC Driver
Character
CHAR, VARCHAR, LONG, CHAR BYTE, VARCHAR BYTE, LONG BYTE
Numeric
DECIMAL, FIXED, INTEGER, SMALLINT, FLOAT, REAL, DOUBLE
PRECISION
Date
DATE, TIME, TIMESTAMP
Other
BOOLEAN, CHAR EBCDIC, VARCHAR EBCDIC
C Data Types
ODBC C data types represent those data types of C variables in which the application data
intended for communication with the database is processed.
Relationship Between SQL and C Data Types
fCType
ODBC C Typedef
C Type
SQL_C_CHAR
SQLCHAR *
unsigned char *
SQL_C_SSHORT SQLSMALLINT
short
int
SQL_C_SLONG
SQLINTEGER
long int (32 bit)
SQL_C_USHORT
SQLUSMALLINT
unsigned short int
SQL_C_ULONG
SQLUINTEGER
unsigned long int (32 bit)
SQL_C_FLOAT SQLREAL
float
SQL_C_DOUBLE SQLDOUBLE
double
SQL_C_BIGINT
SQLBIGINT
_int64, long (64 bit)
ODBC Manual: SAP DB
6
Summary of Contents for DB:ODBC
Page 1: ...ODBC Manual SAP DB ...