- 论坛徽章:
- 0
|
我查看了一下,cli调用只能得到update insert delete SQL影响的的行数,select好像不行,不过在cli调用里面,select都是用显示游标的形式查看数据的,所以你直接在遍历数据的循环里面加个计数器吧:
原文:
- SQLRowCount() returns the number of rows in a table that were affected by an
- UPDATE, INSERT, or DELETE statement executed against the table, or a view
- based on the table.
- SQLRETURN SQLRowCount (
- SQLHSTMT StatementHandle, /* hstmt */
- SQLINTEGER *RowCountPtr); /* pcrow */
复制代码- SQLAllocHandle (SQL_HANDLE_STMT, hdbc, &hstmtparent);
- cliRC = SQLExecDirect(hstmtparent, (SQLCHAR *)"delete * FROM ORG", SQL_NTS);
- SQLRowCount (hstmtparent, &numRows);
复制代码 |
|