Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WJyQU-0007gy-Nr for pgsql-odbc@arkaria.postgresql.org; Sun, 02 Mar 2014 04:54:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WJyQU-0000xL-2j for pgsql-odbc@arkaria.postgresql.org; Sun, 02 Mar 2014 04:54:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WJyQS-0000xC-6Q for pgsql-odbc@postgresql.org; Sun, 02 Mar 2014 04:54:56 +0000 Received: from sd.tpf.co.jp ([210.161.239.34]) by magus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WJyQK-0005Mv-1w for pgsql-odbc@postgresql.org; Sun, 02 Mar 2014 04:54:55 +0000 Received: (qmail 18601 invoked by uid 512); 2 Mar 2014 04:54:42 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 2 Mar 2014 04:54:42 -0000 Received: from unknown (HELO ?192.168.1.4?) (183.76.63.174) by sd.tpf.co.jp with SMTP; 2 Mar 2014 04:54:42 -0000 Message-ID: <5312B98A.90901@tpf.co.jp> Date: Sun, 02 Mar 2014 13:54:34 +0900 From: Hiroshi Inoue User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Heikki Linnakangas CC: Christoph Berg , PostgreSQL ODBC , psqlodbc@packages.debian.org Subject: Re: 09.03.0100 cursor failures on various architectures References: <20140212104524.GA4409@msgid.credativ.de> <52FE1220.9050205@vmware.com> <530C177F.2030906@tpf.co.jp> <530C78F7.5050304@vmware.com> <530CB308.6030507@tpf.co.jp> <530CCB30.8090606@vmware.com> <530D4139.7090707@tpf.co.jp> <530DAB26.9000907@vmware.com> <530F21F1.6000406@tpf.co.jp> <53105C83.9090605@vmware.com> In-Reply-To: <53105C83.9090605@vmware.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 (2014/02/28 18:53), Heikki Linnakangas wrote: > On 02/27/2014 01:30 PM, Hiroshi Inoue wrote: >> (2014/02/26 17:51), Heikki Linnakangas wrote: >>> It works on Windows, because sizeof(long) == sizeof(SQLINTEGER) on >>> Windows, and it works with unixODBC because unixODBC defines SQL_C_LONG >>> as 32-bits regardless of the actual width of "long". >> >> The ODBC spec clearly mentiones that SQL_C_LONG corresponds to >> SQLINTEGER from the first. > > It also clearly says that the native C type corresponding SQL_C_LONG and > SQL_INTEGER is "long". It's foramtive as you taught me about SQLINTEGER in SQL/CLI. Microsoft gave an example which can be used in their working 16-bit OSs and comimg 32-bit OSs. Please note that at that time neither SQL/CLI nor ODBC guaranteed that the spec would be valid under 64-bit paltforms. It was not so long ago the spec of 64-bit ODBC was determined. >> Though you emphasize ODBC is a superset, ODBC was not a superset >> of sql/cli from the first. In the first place SQL/CLI didn't exist >> when ODBC was introduced. Of cource SQL_C_XXXX was not an extension >> of sql/cli spec then. You can't find SQL_C_XXXX because SQL_C_XXXX >> is a C-specific concept and maybe sql/cli shrinked the spec so as >> to avoid language-specific concept. As a result the spec uses the >> same notations SQL_xxxx for different kind of concepts. ODBC uses >> different notations for different kind of concepts. > > Yeah. > >> Which do you prefer? > > I would recommend applications to not use SQL_C_xxx type codes. I would > recommend using a SQLINTEGER variable with SQL_INTEGER type code. That's > the most readable, and most portable option. > (I actually like the idea of separate SQL_C_xxx type codes, to refer to > the native types. Unfortunately such a use is inappropriate in database programing. For example I can find the following in SQL/CLI spec. 2.2.2 Data type for C For binary compatibility of object modules, applications must use symbolic data types defined ... It's very important and you are saying the opposite of SQL/CLI recommendation from the first. What you have to discuss with is the Open Group not unixODBC. >> Now I'm examining what SQLINTEGER means in SQL/CLI spec though >> it may be an old one. >> Hmmm, could you please tell me SQLINTEGER is a 32-bit integer, >> 64-bit one or platform-dependent one on 64-bit platforms? >> I find a line >> SQLINTEGER long Length of buffers for column data and ... >> Is it right in the latest spec? > > Hmm, I don't see that line in my copy. But it does include a sample > sqlcli.h header file that has this in Annex H: > > typedef long SQLINTEGER; > typedef long long SQLBIGINT; > > That probably assumes that "long" is 32-bits wide. It's very important whether SQLINTEGER means 32-bit or 64-bit in 64-bit platforms. If SQLINTEGER means 64-bit integers in SQL/CLI, I have to tell members of this list not to use it. > The Annex has been > marked as "informative", so it's only meant as an example, though. Yes it's formative. And so is for ODBC. As you emphasized many times ODBC became a superset of SQL/CLI conseqently. 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