如果我使用SQLExecDirect
执行查询:
UPDATE mytable set mycol = 2 where mycol = 1;
我如何知道已更新了多少行?
答案 0 :(得分:0)
参考Here
功能原型:
SQLRETURN SQLRowCount(
SQLHSTMT hstmt, /* 32-bit input -- statement handle */
SQLINTEGER *RowCount /* 32-bit output */
);
示例示例: -
#include "sqlcli.h"
SQLINTEGER row_count;
...
if (SQLExecDirect(hstmt,"UPDATE QUERY HERE;",SQL_NTS)>=0) {
if (SQLRowCount(hstmt,&row_count)>=0) {
/* The value of row_count is 1. */ } }