X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 167A1D7F3F for ; Mon, 10 Oct 2005 08:11:33 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 88253-03 for ; Mon, 10 Oct 2005 11:11:27 +0000 (GMT) Received: from mailout04.sul.t-online.com (mailout04.sul.t-online.com [194.25.134.18]) by svr1.postgresql.org (Postfix) with ESMTP id DF9F8D7DBE for ; Mon, 10 Oct 2005 08:11:28 -0300 (ADT) Received: from fwd33.aul.t-online.de by mailout04.sul.t-online.com with smtp id 1EOvZ3-0001j0-04; Mon, 10 Oct 2005 13:11:29 +0200 Received: from [192.168.70.3] (bHqu6wZEQecJEpBlcLufs8aMpEhGj3-bxQUS4A1P1pDw-s6afKA4UG@[217.251.62.33]) by fwd33.sul.t-online.de with esmtp id 1EOvYv-0Et7BI0; Mon, 10 Oct 2005 13:11:21 +0200 Message-ID: <434A4C48.7030101@t-online.de> Date: Mon, 10 Oct 2005 13:11:04 +0200 From: Marten Feldtmann Organization: Privat User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: de-DE, de, en-us, en MIME-Version: 1.0 To: Dave Page Cc: pgsql-odbc@postgresql.org Subject: Re: Windows, ODBC drivers and strange points ... References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-ID: bHqu6wZEQecJEpBlcLufs8aMpEhGj3-bxQUS4A1P1pDw-s6afKA4UG X-TOI-MSGID: 8166deb1-e8ed-4caa-b348-cb3caa18efde X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200510/34 X-Sequence-Number: 6136 Dave Page schrieb: >> >> >>a) All column names are returned from the database >> in lowercase and not in the form the client send >> then when doing the "create table ..." statement. >> >> Which leads to the problem, that other frameworks >> on top of it do not find their columns do make the >> oo-rdbms mapping stuff. >> >> > >No, table names are returns in the correct case: > > Successfully connected to DSN 'foo'. >SQLTables: >In: StatementHandle = 0x003B18D8, CatalogName = SQL_NULL_HANDLE, >NameLength1 = 0, SchemaName = SQL_NULL_HANDLE, NameLength2 = 0, > TableName = SQL_NULL_HANDLE, NameLength3 = 0, TableType = >SQL_NULL_HANDLE, NameLength4 = 0 >Return: SQL_SUCCESS=0 > >Get Data All: >"TABLE_QUALIFIER", "TABLE_OWNER", "TABLE_NAME", "TABLE_TYPE", "REMARKS" >, "public", "MiXeD_CaSe_TaBlE", "TABLE", "" >, "public", "UPPER_CASE_TABLE", "TABLE", "" >, "public", "lower_case_table", "TABLE", "" >3 rows fetched from 5 columns. > >Are you sure you quoted the names when you created them? If not, the >server will have folded them to lower case. > > > This means, that under PostgreSQL one should in general quote the column names when creating them ? Do I also have to quote them in the SELECT statements ??? >>b) All strings returned by the ODBC driver are defined >> in a buffer, which is offered to the ODBC subsystem >> as a string doubled in size - though I told the >> databaase NOT to create a UNICODE db. >> >> An example: a column has the result type char(15). The >> ODBC drivers put the result of this column into a >> memory with a size of 30 characters. >> >> The ODBC subsystem now thinks: fine - I've a character >> column with size 30 and creates a string 30 characters >> long and one gets 15 corrects characters and 15 "0" (null) >> bytes. >> >> > >With 3 bytes of data, (ie. The word 'foo') I get: > >SQLGetData: >In: Statementhandle = 0x003B18D8, ColumnNumber = 1, >TargetType = SQL_C_CHAR=1, TargetValuePtr = 0x000952D0, BufferLength = >600, > StrLen_or_IndPtr = 0x00093E58 >Return: SQL_SUCCESS=0 >Out: *TargetValuePtr = "foo", *StrLen_or_IndPtr = 3 > >When I request an SQL_C_CHAR, or if I request a SQL_C_WCHAR: > >SQLGetData: >In: Statementhandle = 0x003B18D8, ColumnNumber = 1, >TargetType = SQL_C_WCHAR=-8, TargetValuePtr = 0x00097FF8, BufferLength = >600, > StrLen_or_IndPtr = 0x0009F2F8 >Return: SQL_SUCCESS=0 >Out: *TargetValuePtr = "foo", *StrLen_or_IndPtr = 6 > >Regards, Dave. > Ok, this is true - but this is not my problem. How do I get to know, that the source type is either SQL_C_CHAR or SQL_C_WCHAR - this is the problem. I thought this would be possible with the COlumnDesc function - but this seems not to be the case. By the way: what happens if you have UNICODE values in the buffer and you want the target type SQL_C_CHAR ??? Is this allowed ? What code page is then used ? The system code page or the application code page ? Marten