Hitachi

Hitachi Advanced Database Application Development Guide


16.9.6 SQLFetch

Organization of this subsection

(1) Function

This ODBC function fetches the next row set of data from the result set and returns data for all columns associated by SQLBindCol.

(2) Format

SQLRETURN SQLFetch
(
  SQLHSTMT          StatementHandle    /* In */
)

(3) Arguments

StatementHandle

Specifies a statement handle.

(4) Return value

This ODBC function returns SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_NO_DATA, SQL_ERROR, or SQL_INVALID_HANDLE.

(5) SQLSTATE

This ODBC function returns one of the following SQLSTATE values:

SQLSTATE

Description

Remarks

Returned

01000

General warning

--

N

01004

Character string data was right-truncated

Character string data other than spaces or binary data other than NULL was truncated from the character string or binary data returned to a column. If it was a character string value, it was right-truncated.

Y

01S01

Error in row

An error occurred while fetching one or more rows.

N

01S07

Fractional truncation

The fractional part of the numeric value was truncated. For time, time stamp, and interval data types that contain a time component, the fractional part of the time was truncated. The function returns SQL_SUCCESS_WITH_INFO.

Y

01S51

Code replacement occurred during conversion of character encoding

A character code that cannot be converted was detected and then replaced with the specified character. The function returns SQL_SUCCESS_WITH_INFO.

Y

07006

Restricted data type attribute violation

The data value of a column in the result set cannot be converted to the data type specified by TargetType in SQLBindCol.

Y

07009

Invalid descriptor index

--

Y

08S01

Communication link failure

N

22001

Character string data was right-truncated

N

22002

Required indicator variable not supplied

NULL data was fetched into a column that has a null pointer for one of the following:

  • StrLen_or_IndPtr set by SQLBindCol

  • SQL_DESC_INDICATOR_PTR set by SQLSetDescField, SQLSetDescFieldW, SQLSetDescRec, or SQLSetDescRecW

Y

22003

Numeric value out of range

The integer part of the numeric value (numeric value or character string) was deleted.

Y

22007

Invalid datetime format

A character column was bound to a date, time, or time stamp C structure, but the value in the column is an invalid date, time, or time stamp.

Y

22012

Division by zero

A value obtained from an arithmetic expression resulting in division by zero was returned.

N

22015

Interval field overflow

--

N

22018

Invalid character value for cast specification

Y

24000

Invalid cursor status

StatementHandle is in executed status, but no result set is associated.

Y

40001

Serialization failure

--

N

40003

Statement completion unknown

N

5C002

Character encoding conversion error

Y

5C037

Data format error

Y

5C038

Data conversion error

There is an error in the acquired result data or in the specification of the receiving area.

Y

HY000

General error

--

N

HY001

Memory allocation error

The memory required to execute or complete the function has not been allocated for the HADB ODBC driver.

N

HY003

Invalid application buffer data type

The C data type set by SQLBindCol is an invalid data type.

Y

HY008

Operation cancelled

--

N

HY009

Invalid use of null pointer

Y

HY010

Function sequence error

Y

HY013

Memory management error

Y

HY090

Invalid string or buffer length

Y

HY104

Invalid precision or scale value

Y

HY107

Row value out of range

N

HYC00

Optional feature not implemented

The HADB ODBC driver or the HADB server does not support the conversion specified by the combination of TargetType in SQLBindCol and the SQL data type of the corresponding column.

Y

HYT01

Connection timeout expired

--

N

IM001

Driver does not support this function

N

Legend:

Y: This SQLSTATE might be returned by the HADB ODBC driver.

N: This SQLSTATE is not returned by the HADB ODBC driver.

--: None

(6) Notes

The driver does not support the functionality to return row statuses to a row status array.