Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxWwj-00039b-V7 for pgsql-odbc@arkaria.postgresql.org; Tue, 22 Jan 2013 06:02:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TxWwj-0002DV-1f for pgsql-odbc@arkaria.postgresql.org; Tue, 22 Jan 2013 06:02:57 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxWwi-0002DJ-HA for pgsql-odbc@postgresql.org; Tue, 22 Jan 2013 06:02:56 +0000 Received: from mailout10.t-online.de ([194.25.134.21]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TxWwg-0007DP-Kg for pgsql-odbc@postgresql.org; Tue, 22 Jan 2013 06:02:55 +0000 Received: from fwd09.aul.t-online.de (fwd09.aul.t-online.de ) by mailout10.t-online.de with smtp id 1TxWwc-00023k-78; Tue, 22 Jan 2013 07:02:50 +0100 Received: from [192.168.178.25] (EfGRHGZYYhF-75jKsdLxziCJuXTkT2cW6invGPBYvZvQ-JgA9-VOQg0ZpGzxw5GgJT@[84.189.62.131]) by fwd09.t-online.de with esmtp id 1TxWwZ-0z7WzY0; Tue, 22 Jan 2013 07:02:47 +0100 Message-ID: <50FE2B7F.7040202@t-online.de> Date: Tue, 22 Jan 2013 07:02:39 +0100 From: Johann Letzel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Heikki Linnakangas CC: Hiroshi Inoue , pgsql-odbc@postgresql.org Subject: Re: Bug in SQLRowCount ? References: <1TvloP-15Bhtg0@fwd04.aul.t-online.de> <50F7F7D4.40307@tpf.co.jp> <50F82EC5.60701@vmware.com> In-Reply-To: <50F82EC5.60701@vmware.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ID: EfGRHGZYYhF-75jKsdLxziCJuXTkT2cW6invGPBYvZvQ-JgA9-VOQg0ZpGzxw5GgJT X-TOI-MSGID: 941364c5-1117-4363-a0f1-1d1b7d6fe096 X-Pg-Spam-Score: -1.9 (-) 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 Hi ! A big thanks for the tips :) I solved it now by the use of SQL_ATTR_PARAMS_PROCESSED_PTR and SQL_ATTR_PARAM_STATUS_PTR. By the way: MSSQL also returns SQL_PARC_BATCH ;) Regards Johann Am 17.01.2013 18:03, schrieb Heikki Linnakangas: > On 17.01.2013 16:05, Johann Letzel wrote: >> 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 ? > > According to this: > http://msdn.microsoft.com/en-us/library/windows/desktop/ms711818%28v=vs.85%29.aspx, > both behaviors are permitted. When the driver returns SQL_PARC_BATCH, > when you call SQLGetInfo(conn, SQL_PARAM_ARRAY_ROW_COUNTS, ... ), the > driver returns a separate row count for each parameter (PostgreSQL). > When it returns SQL_PARC_NO_BATCH, it returns a single row count that's > the sum of all parameters (MSSQL). In a portable application, you need > to call SQLGetInfo, and deal with both behaviors. > > - Heikki > -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc