Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tvq6h-0001ts-UQ for pgsql-odbc@arkaria.postgresql.org; Thu, 17 Jan 2013 14:06:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tvq6h-0004B4-FU for pgsql-odbc@arkaria.postgresql.org; Thu, 17 Jan 2013 14:06:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tvq6g-0004Aw-TU for pgsql-odbc@postgresql.org; Thu, 17 Jan 2013 14:06:15 +0000 Received: from mailout05.t-online.de ([194.25.134.82]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tvq6d-0005Oj-9O for pgsql-odbc@postgresql.org; Thu, 17 Jan 2013 14:06:14 +0000 Received: from fwd06.aul.t-online.de (fwd06.aul.t-online.de ) by mailout05.t-online.de with smtp id 1Tvq6b-0006wm-4m; Thu, 17 Jan 2013 15:06:09 +0100 Received: from [31.227.183.136] (TWtOp0Z68hIHC0ik75VrYssaS9mS+tggK9wFGxW+fTEaTaeRS823I5UCK4Djt-DZSu@[80.187.96.177]) by fwd06.t-online.de with esmtp id 1Tvq6Z-1z52EC0; Thu, 17 Jan 2013 15:06:07 +0100 User-Agent: K-9 Mail for Android In-Reply-To: <50F7F7D4.40307@tpf.co.jp> References: <1TvloP-15Bhtg0@fwd04.aul.t-online.de> <50F7F7D4.40307@tpf.co.jp> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----RAMIAVJ2NUSTX5MDICSLZYI8U31QJX" Subject: Re: Bug in SQLRowCount ? From: Johann Letzel Date: Thu, 17 Jan 2013 15:05:41 +0100 To: Hiroshi Inoue CC: pgsql-odbc@postgresql.org Message-ID: X-ID: TWtOp0Z68hIHC0ik75VrYssaS9mS+tggK9wFGxW+fTEaTaeRS823I5UCK4Djt-DZSu X-TOI-MSGID: 8c0ab2fd-5c23-4c49-9ca8-557aa8603b83 X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org ------RAMIAVJ2NUSTX5MDICSLZYI8U31QJX Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi ! Tanks for the reply. But according to the ODBC API SQLRowCount should retrieve the number of affected rows by the statement. Why does PostgreSQL gives a 1 and MSSQL the number of inserted/updated rows ? Regards Johann Hiroshi Inoue schrieb: >(2013/01/17 18:31), j.letzel@t-online.de wrote: >> Hello ! >> >> I maintain a backend in a commercial context. The backend provides >> access to MS SQLServer (via ODBC) and Oracle (via OCI). Now I want to >> make it ready for PostgreSQL via ODBC. >> >> For performance reasons we use bulk inserts/updates. >> >> This is done in this manner: >> >> SQLAllocStmt >> >> SQLPrepare // insert into kfztest.KP values (?,?,...,?) >> >> SQBindParameter // for each column >> >> ... >> >> SQLSetStmtAttr // SQL_ATTR_PARAMSET_SIZE to 523 >> >> SQLSetStmtAttr // SQL_ATTR_PARAM_STATUS_PTR to an array of >SQLSMALLINT >> >> SQLSetStmtAttr // SQL_ATTR_PARAMS_PROCESSED_PTR to an SQLULEN >variable >> >> SQLExecute // ends with SQL_SUCCESS >> >> SQLRowCount // delivers 1 !!!! > >The driver gives individual row counts for each parameter set. >SQLGetInfo(.., SQL_PARAM_ARRAY_ROW_COUNTS) returns SQL_PARC_BATCH. > >regards, >Hiroshi Inoue > > > >-- >Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) >To make changes to your subscription: >http://www.postgresql.org/mailpref/pgsql-odbc ------RAMIAVJ2NUSTX5MDICSLZYI8U31QJX Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit Hi !

Tanks for the reply.

But according to the ODBC API SQLRowCount should retrieve the number of affected rows by the statement.

Why does PostgreSQL gives a 1 and MSSQL the number of inserted/updated rows ?

Regards

Johann



Hiroshi Inoue <inoue@tpf.co.jp> schrieb:
(2013/01/17 18:31), j.letzel@t-online.de wrote:
Hello !

I maintain a backend in a commercial context. The backend provides
access to MS SQLServer (via ODBC) and Oracle (via OCI). Now I want to
make it ready for PostgreSQL via ODBC.

For performance reasons we use bulk inserts/updates.

This is done in this manner:

SQLAllocStmt

SQLPrepare // insert into kfztest.KP values (?,?,...,?)

SQBindParameter // for each column

...

SQLSetStmtAttr // SQL_ATTR_PARAMSET_SIZE to 523

SQLSetStmtAttr // SQL_ATTR_PARAM_STATUS_PTR to an array of SQLSMALLINT

SQLSetStmtAttr // SQL_ATTR_PARAMS_PROCESSED_PTR to an SQLULEN variable

SQLExecute // ends with SQL_SUCCESS

SQLRowCount // delivers 1 !!!!

The driver gives individual row counts for each parameter set.
SQLGetInfo(.., SQL_PARAM_ARRAY_ROW_COUNTS) returns SQL_PARC_BATCH.

regards,
Hiroshi Inoue


------RAMIAVJ2NUSTX5MDICSLZYI8U31QJX--