Scalable Database Server, HiRDB Version 8 UAP Development Guide

[Contents][Index][Back][Next]

13.5 ODBC function data types and HiRDB data types

Table 13-3 shows the correspondence between ODBC function data types and server HiRDB data types.

ODBC function data type refers to an SQL data type that is specified in an argument of an ODBC function.

Table 13-3 ODBC function data types and HiRDB data types

Classification ODBC data type HiRDB data type Description Availability
Character data SQL_CHAR CHAR(n) Fixed-length character string U
SQL_VARCHAR VARCHAR(n) Variable-length character string U
SQL_LONGVARCHAR VARCHAR(n) Variable-length character string U
SQL_CHAR NCHAR(n) Fixed-length national character string NATIONAL CHARACTER(n) U
SQL_VARCHAR NVARCHAR(n) Variable-length national character string U
SQL_CHAR MCHAR(n) Fixed-length mixed character string U
SQL_VARCHAR MVARCHAR(n) Variable-length mixed character string U
Numeric data SQL_DECIMAL DEC[IMAL](p,s) Fixed-point number
Precision (total number of digits) = p, Scale (number of digits below the decimal point) = s
1 [Figure] p [Figure] 15, 0 [Figure] s [Figure] p
U
SQL_NUMERIC [Figure] NU
SQL_SMALLINT SMALLINT Integer from -32,768 to 32,767 U
SQL_INTEGER INTEGER Integer from -2,147,483,648 to 2,147,483,647 U
SQL_TINYINT [Figure] Integer from -256 to 255 NU
SQL_BIGINT [Figure] 1-digit sign and 19-digit integer NU
SQL_REAL SMALLFLT,REAL Single-precision floating-point number U
SQL_FLOAT FLOAT, DOUBLE PRECISION Double-precision floating-point number U
SQL_DOUBLE FLOAT, DOUBLE PRECISION Double-precision floating-point number U
SQL_BIT [Figure] Bit NU
SQL_BINARY [Figure] Fixed-length binary data NU
SQL_LONGVARBINARY BINARY(n) Variable-length binary data U
SQL_LONGVARBINARY BLOB Variable-length binary data U
Date and time data SQL_TYPE_DATE DATE Date U
SQL_TYPE_TIMESTAMP TIMESTAMP Date/time U
SQL_TYPE_TIME TIME Time U
[Figure]* INTERVAL YEAR TO DAY Date interval NU
SQL_INTERVAL_HOUR_TO_SECOND INTERVAL HOUR TO SECOND Time interval U
User-defined type [Figure] Abstract data type Abstract data type NU

[Figure]: Data type not available in ODBC.

U: Can be used.

NU: Cannot be used.

* Database data types in the server are reported without change.

Note
For details about the maximum character string lengths and value ranges for the various data types, see the manual HiRDB Version 8 SQL Reference.
Organization of this section
(1) Facilities available to ODBC functions
(2) Setting update and deletion operations that use cursors
(3) Setting driver options

(1) Facilities available to ODBC functions

When a UAP uses ODBC functions to access the HiRDB system in the server, not all HiRDB facilities are available to the UAP. Table 13-4 lists the facilities that can be used by such a UAP.

Table 13-4 Available facilities

Facility Availability
Obtaining special column information [Figure]
Obtaining index information U
Using date and time data types U1
Using repetition columns NU3
Using array columns [Figure]
Obtaining table and column headers [Figure]
Asynchronous processing NU
Using the escape character for the LIKE predicate U
Obtaining an updated row count U
Setting the timeout value for logging in NU
Using Japanese data types U2
Executing definition SQL statements U

U: Can be used.

NU: Cannot be used.

[Figure]: Not a DBMS function

1 The INTERVAL YEAR TO DAY data type cannot be used.

2 The database data types are reported without change.

3 A repetition column can be accessed if it has a simple structure without repeated ? parameters.
Example
Column C1 of table T1 is a repetition column.
SELECT C1[1],C1[2] FROM T1             A
SELECT C1 FROM T1                      [Figure]
INSERT INTO T1 VALUES(ARRAY[?,?])      A
INSERT INTO T1 VALUES(?)               [Figure]
A: Can be accessed
[Figure]: Cannot be accessed

(2) Setting update and deletion operations that use cursors

The SQLGetCursorName function obtains the user cursor name that was set with the SQLSetCursorName function. If no cursor name has been set, the SQLGetCursorName function cannot obtain a system-defined cursor. Therefore, set an appropriate user cursor name to update or delete an item with a cursor.

(3) Setting driver options

The options that can be set with the SQLSetConnectOption or SQLGetConnectOption function are limited. Table 13-5 shows the options that can be set.

Table 13-5 Options that can be set with the SQLSetConnectOption and SQLGetConnectOption functions

Option Setting
SQL_ACCESS_MODE SQL_MODE_READ_WRITE
SQL_AUTOCOMMIT SQL_AUTOCOMMIT_OFF or SQL_AUTOCOMMIT_ON
SQL_LOGIN_TIMEOUT [Figure]
SQL_TRANSLATE_DLL [Figure]
SQL_TRANSLATE_OPTION [Figure]
SQL_TXN_ISOLATION [Figure]

[Figure]: Cannot be set