Specification: | 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
Tabelle 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
Tabelle 79. SQLRowCount SQLSTATEs
SQLSTATE | Description | Explanation |
---|---|---|
40003
08S01 | Kommunikationsverbindungsfehler. | Die Kommunikationsverbindung zwischen Anwendung und Datenquelle wurde unterbrochen, bevor die Funktion vollständig ausgeführt war. |
58004 | Unerwarteter Systemfehler. | Unrecoverable system error. |
HY001 | Speicherzuordnungsfehler. | CLI kann den zur Ausführung und zum Abschluss der Funktion erforderlichen Speicherplatz nicht zuordnen. Möglicherweise steht für den Anwendungsprozess nicht genügend Speicherplatz zur Verfügung. Informationen zu den Beschränkungen der Speicherplatzkapazität sind aus den Konfigurationseinstellungen des Betriebssystems ersichtlich. |
HY010 | Funktionsfolgefehler. | The function is called prior to calling SQLExecute() or SQLExecDirect() for the StatementHandle. |
HY013 | Unerwarteter Speicherverarbeitungsfehler. | CLI kann nicht auf den Speicher zugreifen, der zur (vollständigen) Ausführung der Funktion erforderlich ist. |
Restrictions
None.
Zugehörige Referenzen