Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id D85579FB6EF for ; Mon, 23 Jul 2007 11:30:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 71460-07 for ; Mon, 23 Jul 2007 11:29:58 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from core.softwarium.net (core.softwarium.net [212.110.147.5]) by postgresql.org (Postfix) with ESMTP id D43929FB400 for ; Mon, 23 Jul 2007 11:30:04 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by core.softwarium.net (Postfix) with ESMTP id CC5391980B9; Mon, 23 Jul 2007 17:28:24 +0300 (EEST) Received: from core.softwarium.net ([127.0.0.1]) by localhost (core [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 14077-01; Mon, 23 Jul 2007 17:28:22 +0300 (EEST) Received: from [212.110.147.73] (gwynn.cris.net [212.110.147.73]) by core.softwarium.net (Postfix) with ESMTP id 21AF0198099; Mon, 23 Jul 2007 17:28:22 +0300 (EEST) Message-ID: <46A4BDFB.1080202@commandprompt.com> Date: Mon, 23 Jul 2007 17:40:59 +0300 From: Andrei Kovalevski User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: "Zubkovsky, Sergey" Cc: pgsql-odbc@postgresql.org Subject: Re: Varchar parameter conversion References: <528853D3C5ED2C4AA8990B504BA7FB850106DDE4@sol.transas.com> In-Reply-To: <528853D3C5ED2C4AA8990B504BA7FB850106DDE4@sol.transas.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at softwarium.net X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/49 X-Sequence-Number: 9104 Hello, Try to use statements with parameters: SQLBindParameters(stmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_VARCHAR, query_length, 0, param_ptr, query_length, buff_ptr); SQLExecDirect(stmt, "{call SomeProc(?}}"); Zubkovsky, Sergey wrote: > > Hello, > > My client program is developed on C++ & ODBC. > > It’s a Windows Unicode application. > > I’m trying to pass a “varchar” parameter value to a user-defined > stored procedure. > > Each character of this actual parameter value (which ASC code is > greater than 127) is transformed into some two chars. > > This value is stored and bound as a non-Unicode string (traditional > C-string) in the program. > > So, some conversion happens for these characters. > > It seems to me that it’s the ODBC driver’s intervention. > > Is that right? > > And how can I avoid this unwanted conversion? > > Additional environment info: > > OS: Windows XP SP2 > > PostgreSQL version: “PostgreSQL 8.2.4 on i686-pc-mingw32, compiled by > GCC gcc.exe (GCC) 3.4.2 (mingw-special)” > > ODBC driver version: PostgreSQL Unicode 8.02.04.00 > > SHOW server_encoding; > > "SQL_ASCII" > > SHOW client_encoding; > > "SQL_ASCII" > > Thank you. >