Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tvsre-0003Nn-Qr for pgsql-odbc@arkaria.postgresql.org; Thu, 17 Jan 2013 17:02:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tvsre-0005rV-Bj for pgsql-odbc@arkaria.postgresql.org; Thu, 17 Jan 2013 17:02:54 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tvsrd-0005rO-RO for pgsql-odbc@postgresql.org; Thu, 17 Jan 2013 17:02:53 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tvsrc-0003cr-Ig for pgsql-odbc@postgresql.org; Thu, 17 Jan 2013 17:02:53 +0000 Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id BE72828347; Thu, 17 Jan 2013 09:02:51 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id BBAE0B0747; Thu, 17 Jan 2013 09:02:51 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id D37411219DB; Thu, 17 Jan 2013 09:05:04 -0800 (PST) X-Virus-Scanned: amavisd-new at zcs-prod-ext-mta-1.vmware.com Received: from zcs-prod-ext-mta-1.vmware.com ([127.0.0.1]) by localhost (zcs-prod-ext-mta-1.vmware.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ubJgfVdnxd8Z; Thu, 17 Jan 2013 09:05:04 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 4941D121586; Thu, 17 Jan 2013 09:05:04 -0800 (PST) Received: from [192.168.1.90] (unknown [10.113.62.14]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Thu, 17 Jan 2013 09:05:02 -0800 (PST) Message-ID: <50F82EC5.60701@vmware.com> Date: Thu, 17 Jan 2013 19:03:01 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11 MIME-Version: 1.0 To: Johann Letzel 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> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -6.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 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