Input Mode

The following table lists the RDBMS API type-names that DB Link uses to send parameter values to the RDBMSs.

RDBMS API Type Symbols Used by DB Link

DB Link

DB2

Informix

MS SQL Server

ODBC

IldByteType

SQL_C_TINYINT

CINTTYPE

SQLINT1

SQL_C_TINYINT

IldIntegerType

SQL_C_LONG

CINTTYPE

SQLINT4

SQL_C_INTEGER

IldRealType

SQL_C_DOUBLE

CDOUBLETYPE

SQLFLT8

SQL_C_DOUBLE

IldStringType

SQL_C_CHAR

CCHARTYPE

SQLCHAR

SQL_C_CHAR

IldDateType

IldDateTimeType

SQL_C_CHAR

CCHARTYPE

SQLDATETIME

SQL_C_CHAR

IldMoneyType

SQL_C_DOUBLE

CDOUBLETYPE

SQLMONEY

SQL_C_DOUBLE

IldLongTextType

SQL_C_CHAR

CLOCATOR

SQLTEXT

SQL_C_CHAR

IldBinaryType

SQL_C_BINARY

CLOCATOR

SQLBIT

SQL_C_BINARY

IldObjectType

-

CROWTYPE

-

-

IldCollectionType

-

CCOLLTYPE

-

-

IldCursorType

-

-

-

-

IldRefType

-

-

-

-

IldCLOBType

SQL_CLOB_LOCATOR

CLOCATOR

-

-

IldBLOBType

SQL_BLOB_LOCATOR

CLOCATOR

-

-

 

DB Link (Continued)

Oracle

Sybase

IldByteType

SQLT_INT

CS_INT

IldIntegerType

SQLT_INT

CS_INT

IldRealType

SQLT_FLT

CS_FLOAT

IldStringType

SQLT_STR

CS_CHAR

IldDateType

IldDateTimeType

SQLT_STR

CS_CHAR

IldMoneyType

SQLT_FLT

CS_FLOAT

IldLongTextType

SQLT_STR

CS_CHAR

IldBinaryType

SQLT_LBI

CS_BINARY

IldObjectType

SQLT_NTY

-

IldCollectionType

SQLT_NTY

-

IldCursorType

SQLT_RSET

-

IldRefType

SQLT_REF

-

IldCLOBType

SQLT_CLOB

-

IldBLOBType

SQLT_BLOB

-

The following special features of the Input Mode are described separately:

Date As String

When the date as string feature is turned off, the DB Link IldDateTime type values are sent using different database client API type symbols.

DB2

SQL_C_TYPE_TIMESTAMP

Informix

CDTIMETYPE

ODBC

SQL_C_TIMESTAMP

Oracle

SQL_TIMESTAMP

Sybase

CS_DATETIME_TYPE

Numeric As String

A similar change happens when the numeric as string feature is turned on:

DB2

SQL_C_NUMERIC

Informix

CCHARTYPE

ODBC

SQL_C_CHAR

Oracle

SQLT_STR

Sybase

CS_NUMERIC

MS SQL Server Limitation

MS SQL Server does not automatically convert string values into integer values; the application must use the SQL function convert:

cout << "Data insertion : " << endl;

const char* insertStr =

((!strncmp(dbms->getName(), "oracle", 6)

|| !strcmp(dbms->getName(), "sqlbase")) ?

"insert into ATABLE values(:1, :2)"

: ((!strcmp(dbms->getName(), "mssql") ||

!IldStrNICaseCmp(dbOdbc, "Microsoft SQL Server", 20)) ?

"insert into ATABLE values (convert(numeric(28, 9), ?), ?)"

: "insert into ATABLE values(?, ?)"));