Table of Contents
This chapter describes the data types used in tbCLI program, and also describes conversion between data types.
A Data type is used to input values to SQL queries and to get the query result.
tbCLI supports the following two types.
Used to access data stored in database.
Used to manipulate data from an application program.
This section describes the default data types provided by Tibero. These data types are used to create schema objects of a database. Also within a tbESQL program, variables corresponding to all data types can be used.
The following table shows Tibero data types.
For more information, refer to Tibero SQL Reference Guide.
The followings are detailed descriptions of each data type.
This section describes tbCLI data type that application developers use to create a database program.
The following is a table which shows typedef names of C and its corresponding data types of C.
C's typedef | C's data type |
---|---|
SQLCHAR | unsigned char |
SQLSCHAR | signed char |
SQLSMALLINT | short int |
SQLUSMALLINT | unsigned short int |
SQLINTEGER | long int |
SQLUINTEGER | unsigned long int |
SQLREAL | float |
SQLDOUBLE, SQLFLOAT | double |
DATE_STRUCT, SQL_DATE_STRUCT | [Example 2.1] |
TIME_STRUCT, SQL_TIME_STRUCT | [Example 2.2] |
TIME_STAMP_STRUCT, SQL_TIMESTAMP_STRUCT | [Example 2.3] |
The following are examples of using tbCLI data types, which corresponds to C's typedef name.
DATE_STRUCT, SQL_DATE_STRUCT
[Example 2.1] DATE_STRUCT, SQL_DATE_STRUCT
typedef struct tagDATE_STRUCT { SQLSMALLINT year; SQLUSMALLINT month; SQLUSMALLINT day; };
TIME_STRUCT, SQL_TIME_STRUCT
[Example 2.2] TIME_STRUCT, SQL_TIME_STRUCT
struct tagTIME_STRUCT { SQLUSMALLINT hour; SQLUSMALLINT minute; SQLUSMALLINT second; };
TIME_STAMP_STRUCT, SQL_TIMESTAMP_STRUCT
[Example 2.3] TIME_STAMP_STRUCT, SQL_TIMESTAMP_STRUCT
struct tagTIMESTAMP_STRUCT { SQLSMALLINT year; SQLUSMALLINT month; SQLUSMALLINT day; SQLUSMALLINT hour; SQLUSMALLINT minute; SQLUSMALLINT second; SQLUINTEGER fraction; };