SQLRowCount--Get row count

Purpose

Specification: DB2 CLI 1.1 ODBC 1.0 ISO CLI

SQLRowCount() returns the number of rows in a table that were affected by an UPDATE, INSERT, DELETE, or SELECT with scrollable cursor statement executed against the table.

SQLExecute() or SQLExecDirect() must be called before calling this function.

Syntax

SQLRETURN   SQLRowCount      (SQLHSTMT          StatementHandle,   /* hstmt */
                              SQLINTEGER   FAR  *RowCountPtr);     /* pcrow */

Function arguments

Tabulka 78. SQLRowCount arguments

Data type Argument Use Description
SQLHSTMT StatementHandle input Statement handle.
SQLINTEGER RowCountPtr output Pointer to location where the number of rows affected is stored.

Usage

If the last executed statement referenced by the input statement handle is not an UPDATE, INSERT, or DELETE statement, or if it did not execute successfully, then the function sets the contents of RowCountPtr to -1.

Any rows in other tables that might have been affected by the statement are not included in the count.

Return codes

Diagnostics

Tabulka 79. SQLRowCount SQLSTATEs

SQLSTATE Description Explanation
40003

08S01

Došlo k selhání komunikačního propojení. Před dokončením funkce došlo k selhání komunikačního propojení.
58004 Došlo k neočekávanému selhání systému. Unrecoverable system error.
HY001 Došlo k selhání alokace paměti. DB2 CLI nebyl schopen alokovat paměť potřebnou pro další podporu zpracování nebo dokončení funkce. Paměť pro úroveň procesů byla vyčerpána aplikačním procesem. V konfiguraci operačního systému vyhledejte informace o omezení paměti pro úroveň procesů.
HY010 Došlo k chybě funkční posloupnosti. The function is called prior to calling SQLExecute() or SQLExecDirect() for the StatementHandle.
HY013 Došlo k neočekávané chybě správy paměti. Rozhraní DB2 CLI nemá přístup k paměti potřebné pro podporu spuštění nebo dokončení funkce.

Restrictions

None.

Související odkazy