Message-ID: From: "Oliver0624 (@Oliver0624)" To: "postgresql-interfaces/psqlodbc" Date: Thu, 18 Jul 2024 10:19:53 +0000 Subject: [postgresql-interfaces/psqlodbc] issue #34: SQLRowCount set affected row numbers is incorrect when use SQLBindParameter and SQLSetStmtAttr for SQL_ATTR_PARAMSET_SIZE List-Id: X-GitHub-Author-Id: 90174330 X-GitHub-Author-Login: Oliver0624 X-GitHub-Issue: 34 X-GitHub-Repo: postgresql-interfaces/psqlodbc X-GitHub-State: open X-GitHub-Type: issue X-GitHub-Url: https://github.com/postgresql-interfaces/psqlodbc/issues/34 Content-Type: text/plain; charset=utf-8 Hi, I'm tring to insert and update a lot of records using SQLBindParameter and SQLSetStmtAttr, but SQLRowsCount returned record number affected by ONLY the LAST SINGLE SQL STATEMENT. Here is my code sequence. 1. status = SQLBindParameter(cda, parm_pos, param_type, ftype, mapped_sqltype, temp_column_size, sqltype == SQL_TYPE_TIMESTAMP ? odbc_date_scale : 0, v.p_v, buflen, v.p_len); 2. status = SQLSetStmtAttr(cda, SQL_ATTR_PARAMSET_SIZE, temp_iters, SQL_NTS); 3. status = SQLExecute(cda); 4. SQLRowCount(cda, affected_num); I inserted 1000 records into the table, but affected_num set by SQLRowCount is 1 I searched the source code for this issue, and found in CC_send_query_append (connection.c:2062) ![image](https://github.com/user-attachments/assets/69b6cd4a-556e-4ac2-a084-e621d05bd499) My question is : Is this line (connection.cpp : 2062) has a bug? I think it may use '+=' rather than '='. lack of libpg.dll and headers, I cannot compile the source code and check my idea. ---------------------------------------- July 23,2024 OK. I've found how to fix this bug, and have checked it on my computer. ( It's not so easy to fix this bug ) Can I send a pull request ?