Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ubq2U-0006lj-L2 for pgsql-odbc@arkaria.postgresql.org; Mon, 13 May 2013 10:31:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Ubq2U-0003N4-3k for pgsql-odbc@arkaria.postgresql.org; Mon, 13 May 2013 10:31:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ubq2T-0003Mw-D4 for pgsql-odbc@postgresql.org; Mon, 13 May 2013 10:31:29 +0000 Received: from smtp-outbound-1.vmware.com ([208.91.2.12]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Ubq2I-0004MP-L2 for pgsql-odbc@postgresql.org; Mon, 13 May 2013 10:31:27 +0000 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 783192849A; Mon, 13 May 2013 03:31:15 -0700 (PDT) Received: from zcs-prod-ext-mta-2.vmware.com (zcs-prod-ext-mta-2.vmware.com [10.113.62.224]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 73EEC18803; Mon, 13 May 2013 03:31:15 -0700 (PDT) Received: from zcs-prod-ext-mta-2.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTP id 47C49C0054; Mon, 13 May 2013 03:31:10 -0700 (PDT) Received: from [192.168.1.90] (zimbra-prod-ext-proxy-vip.vmware.com [10.113.63.87]) by zcs-prod-ext-mta-2.vmware.com (Postfix) with ESMTPSA; Mon, 13 May 2013 03:31:08 -0700 (PDT) Message-ID: <5190C0EE.6090103@vmware.com> Date: Mon, 13 May 2013 13:31:10 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Carlos_Mu=F1oz_Juste?= CC: pgsql-odbc@postgresql.org Subject: Re: Issue with Oracle Database Gateway for ODBC and Unicode References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -7.5 (-------) 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 13.05.2013 12:21, Carlos Mu=F1oz Juste wrote: > We have noticed that this only happens when the column in the where clause > is of type character varying, due to the fact that the Oracle Database > Gateway for ODBC returns all character varying columns in Postgres as type > NVARCHAR2. If we issue the query like this, then the where clause is > passed to Postgres: > > select * from "dps_user"@pg where "id" =3D cast('32422' as nvarchar2(40)) > > This behavior does not happen when we used the psqlodbc ANSI driver, but > unfortunately the Unicode driver is a must because both databases contain > Japanese, Russian and Chinese characters. It does not happen either when > we access the Postgres database through the psqlodbc Unicode driver from, > for example, Microsoft Query, so it has something to do with the Oracle > Database Gateway. > > However, I thought I would post my problem here, just in case you ran into > this problem or heard of someone who did. Having to use the cast as > nvarchar2 works, but it is very cumbersome. I wonder if there would be a > way to configure the psqlodbc driver so that a varchar2 column is returned > instead. To be precise, the driver returns the column type to be the ODBC type=20 SQL_WVARCHAR. Oracle Database Gateway must be translating that into=20 NVARCHAR2. And you would like the column type to be returned as=20 SQL_VARCHAR instead, which the Gateway will hopefully translate into=20 VARCHAR2. As a matter of fact, there is a setting to do that. It's a bit hidden=20 away, it's the "Extra Opts" value 0x4. See=20 http://psqlodbc.projects.pgfoundry.org/docs/config.html. I think it's=20 set in the connection string or ini file as "AB=3D0x4". There should also= =20 be a field for it somewhere in the configuration GUI > I am going to open a service request with Oracle to see if they can help > me on the gateway end. Yeah, seems like a bug or at least a missing feature in the Gateway. - Heikki --=20 Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc