Hitachi

Hitachi Advanced Database Application Development Guide


15.6.2 Notes on using the HADB ODBC driver in ODBC 2.x applications

If SQL_OV_ODBC2 is specified in the SQL_ATTR_ODBC_VERSION attribute of the environment handle, the HADB ODBC driver operates according to the ODBC 2.x specification in relation to the items explained in this subsection.

Organization of this subsection

(1) About SQLSTATE

Pursuant to changes in Open Group and ISO specifications, a number of SQLSTATE values have changed in ODBC 3.x. The HADB ODBC driver returns ODBC 2.x SQLSTATE values mapped according to the following table. For details about SQLSTATE, see List of SQLSTATE values in the manual HADB Messages.

Table 15‒6: Table of SQLSTATE value mapping

No.

ODBC3.x

ODBC2.x

1

07005

24000

2

07009#

S1002

3

S1093

4

22007

22008

5

22018

22005

6

HY001

S1001

7

HY003

S1003

8

HY004

S1004

9

HY007

S1010

10

HY009

S1009

11

HY010

S1010

12

HY011

S1011

13

HY024

S1009

14

HY090

S1090

15

HY091

S1091

16

HY092

S1092

17

HY096

S1096

18

HY100

S1100

19

HY104

S1104

20

HY105

S1105

21

HYC00

S1C00

#

When SQLSTATE is 07009, mapping does not occur on a one-to-one basis. In this scenario, mapping takes place as shown in the following table.

Table 15‒7: Mapping when SQLSTATE is 07009

No.

Function that returns SQLSTATE 07009

SQLSTATE value to which SQLSTATE 07009 is mapped when SQL_OV_ODBC2 is specified

1

SQLBindParameter

S1093

2

SQLColAttribute

S1002

3

SQLDescribeCol

07009

4

SQLDescribeParam

S1093

5

SQLFetch

S1002

6

SQLGetData

S1002

7

SQLGetDescField

07009

8

SQLGetDescRec

07009

9

SQLSetDescRec

07009

10

SQLSetDescField

07009

(2) Return value of SQL_NO_DATA

When an application calls one of the following ODBC functions that executes a DELETE or UPDATE statement that does not affect any rows, the driver returns SQL_SUCCESS. It does not return SQL_NO_DATA.

(3) Return value of SQLGetInfo

The value specified for SQL_ATTR_ODBC_VERSION of the environment handle affects the value returned to SQL_ALTER_TABLE in the following ways: