How to get actual number of rows affected with parameter array

From: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: How to get actual number of rows affected with parameter array
Date: 2015-12-02 07:40:48
Message-ID: CAJrrPGcnwh6OzVCfBh8t6Eb4kaM4JYNqhWFhwfM9rvmiOvuxdQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

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, &param_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

Attachment Content-Type Size
test.sql application/octet-stream 540 bytes
delcnt.c text/x-csrc 4.1 KB

Browse pgsql-odbc by date

  From Date Subject
Next Message Haribabu Kommi 2015-12-09 00:40:14 Error in calling a function with protocol 7.4
Previous Message Christian Ullrich 2015-11-28 19:48:31 Re: Bugs related to getting @@identity