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
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
SQLSTATE | Description | Explanation |
---|---|---|
40003
08S01 | Åë½Å ¸µÅ© ½ÇÆÐ | ÇÔ¼ö°¡ ¿Ï·áÇϱâ Àü¿¡ ÀÀ¿ëÇÁ·Î±×·¥°ú µ¥ÀÌÅÍ ¿øº» »çÀÌÀÇ Åë½Å ¸µÅ©°¡ ½ÇÆÐÇß½À´Ï´Ù. |
58004 | ¿¹»óÄ¡ ¸øÇÑ ½Ã½ºÅÛ ¿À·ù | Unrecoverable system error. |
HY001 | ¸Þ¸ð¸® ÇÒ´ç ¿À·ù | DB2 CLI´Â ÇÔ¼ö ½ÇÇà ¶Ç´Â ¿Ï·á¸¦ Áö¿øÇÏ´Â µ¥ ÇÊ¿äÇÑ ¸Þ¸ð¸®¸¦ ÇÒ´çÇÒ ¼ö ¾ø½À´Ï´Ù. ÀÀ¿ëÇÁ·Î±×·¥ ÇÁ·Î¼¼½º¿¡ ´ëÇÑ ÇÁ·Î¼¼½º ·¹º§ ¸Þ¸ð¸®°¡ °í°¥µÇ¾ú½À´Ï´Ù. ÇÁ·Î¼¼½º ·¹º§ ¸Þ¸ð¸® Á¦ÇÑ»çÇ׿¡ ´ëÇÑ Á¤º¸´Â ¿î¿µ üÁ¦ ±¸¼ºÀ» ÂüÁ¶ÇϽʽÿÀ. |
HY010 | ÇÔ¼ö ¼ø¼ ¿À·ù | The function is called prior to calling SQLExecute() or SQLExecDirect() for the StatementHandle. |
HY013 | ¿¹»óÄ¡ ¸øÇÑ ¸Þ¸ð¸® Á¶Àý ¿À·ù | DB2 CLI´Â ÇÔ¼ö ½ÇÇà ¶Ç´Â ¿Ï·á¸¦ Áö¿øÇÏ´Â µ¥ ÇÊ¿äÇÑ ¸Þ¸ð¸®¿¡ ¾×¼¼½ºÇÒ ¼ö ¾ø½À´Ï´Ù. |
Restrictions
None.
Related reference