Обсуждение: How to get actual number of rows affected with parameter array

Поиск
Список
Период
Сортировка

How to get actual number of rows affected with parameter array

От
Haribabu Kommi
Дата:
I am having a problem in getting actual number of rows affected when
the test application uses parameter array.

SQLCHAR * strSQL   = "DELETE FROM TSTBL1 WHERE INTCLMN2 = ?";
SQLINTEGER   pPersonIDs2 [2] = {30,10};

The above SQL statement with passed values affects 5 rows in a table.

retcode = SQLGetInfo(hdbc, SQL_PARAM_ARRAY_ROW_COUNTS, ¶m_count, 0, NULL);

The SQLGetInfo function returned SQL_PARC_BATCH as output, that means
it produces individual row counts.

retcode = SQLSetStmtAttr (hstmt, SQL_ATTR_PARAMS_PROCESSED_PTR,
&ParamsProcessed, 0);

The above statement returns the ParamsProcessed value as 2, as we have processed
two values.

retcode=SQLRowCount(hstmt, &RowCount);

The above statement returns the number of rows affected by the
statements with the
first parameter value only. That is value - 3.

I want the rows affected with the second parameter also. Is there any way to get
individual row counts?

Attached test.sql and delcnt.c test files that reproduce this problem.

Regards,
Hari Babu
Fujitsu Australia

Вложения