DB2 driver

<< Click to Display Table of Contents >>

Navigation:  Application development > Database driver characteristics > SQL drivers >

DB2 driver

Previous pageReturn to chapter overviewNext page

This topic discusses features unique to the DB2 SQL Link driver.

DBCLOB data type

The DB2 physical type DBCLOB is not currently supported within the BDE even though schema information indicates that it is an available type. It is suggested that you use either CLOB or BLOB physical types.

Stored procedures

The SQL Links driver for DB2 translates the logical BDE string type (fldZSTRING) to a physical DB2 SQL_CHAR data type when it is passed as a parameter to a stored procedure. This can cause problems for stored procedures that are hard-coded to expect a physical SQL_VARCHAR as a parameter.

Programmers should write stored procedures that examine the sqltype member of the SQLDA structure (for example, input_sqlda->sqlvar[i].sqltype) to determine which data type the client has actually bound, instead of expecting a specific data type.

Creating indexes on AS/400 servers

Due to a problem with the IBM server software version 2.1.1, if you create a new index by specifying an index name that includes lowercase characters and is enclosed in double quotes ("<index_name>"), the index cannot be accessed by the BDE.

For example, the following statement creates an accessible index,

  CREATE INDEX CustNdx ON ....

but the following statement creates an index that the BDE can't access,

  CREATE INDEX "CustNdx" ON ....

If creating an index through a call to DbiAddIndex the szName member in the IDXDesc Parameter should only be uppercase.

Creating BLOB or CLOB columns

When using DbiCreateTable BLOB or CLOB columns created in a DB2 table by the function are set by default to a size of 1MB. To create BLOB columns of different sizes, use Passthrough SQL.

VARBINARY output parameters in stored procedures

In a stored procedure parameter description (SPParamDesc.uFldType), normally a corresponding BDE logical data type is specified. There is one exception. A varbinary output parameter should specify fldBYTES instead of fldVARBYTES.

Calling by name in stored procedures

DB2 only supports calling by number in stored procedures. Always use calling by number instead of calling by name.

 

hmtoggle_plus1SQL driver topics