SQLRowCount--Get row count

Purpose

Specification: interfejs 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

Tabela 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

Tabela 79. SQLRowCount SQLSTATEs

SQLSTATE Description Explanation
40003

08S01

Awaria łącza komunikacyjnego. Łącze komunikacyjne między aplikacją a źródłem danych zostało zerwane przez zakończeniem funkcji.
58004 Nieoczekiwana awaria systemu. Unrecoverable system error.
HY001 Niepowodzenie przy przydzielaniu pamięci. interfejs DB2 CLI nie może przydzielić pamięci potrzebnej do wykonania lub zakończenia funkcji. Przypuszczalnie w procesie aplikacji została wyczerpana pamięć na poziomie procesu. W konfiguracji systemu operacyjnego poszukaj informacji o ograniczeniach pamięci na poziomie procesu.
HY010 Błąd kolejności funkcji. The function is called prior to calling SQLExecute() or SQLExecDirect() for the StatementHandle.
HY013 Nieoczekiwany błąd obsługi pamięci. interfejs DB2 CLI nie mógł uzyskać dostępu do pamięci potrzebnej do wykonania lub zakończenia funkcji.

Restrictions

None.

Informacje pokrewne