Hitachi

Hitachi Advanced Database Application Development Guide


16.9.1 SQLRowCount

Organization of this subsection

(1) Function

This ODBC function returns the number of rows changed by the following processing before this function was executed:

(2) Format

SQLRETURN SQLRowCount
(
  SQLHSTMT       StatementHandle,     /* In */
  SQLLEN       * RowCountPtr          /* Out */
)

(3) Arguments

StatementHandle

Specifies a statement handle.

Specify a value that was output by *OutputHandlePtr of SQLAllocHandle before this function is executed.

RowCountPtr

Specifies a pointer to the buffer in which the number of changed rows is to be returned.

(4) Return value

This ODBC function returns SQL_SUCCESS, 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

HY000

General error

N

HY001

Memory allocation error

N

HY009

Invalid use of null pointer

An invalid value was set in RowCountPtr.

Y

HY010

Function sequence error

--

Y

HY013

Memory management error

N

HY117

Connection suspended

N

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

If the executed SQL statement is UPDATE, INSERT, or DELETE, this function returns the number of rows changed by the request. If the returned value is -1, the possible causes are as follows: