pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Andrei Kovalevski <andyk@commandprompt.com>
To: Zubkovsky, Sergey <Sergey.Zubkovsky@transas.com>
Cc: pgsql-odbc@postgresql.org
Subject: Re: FW: Varchar parameter conversion
Date: Tue, 24 Jul 2007 16:48:59 +0300
Message-ID: <46A6034B.5090505@commandprompt.com> (raw )
In-Reply-To: <528853D3C5ED2C4AA8990B504BA7FB850106DDE6@sol.transas.com >
References: <528853D3C5ED2C4AA8990B504BA7FB850106DDE6@sol.transas.com >
Hello,
I'm not so sure what is going on, unicode version of driver should
provide internal conversion to UTF-8, but value in log file doesn't look
as a valid UTF-8 string:
-!-"-#-$-%-&-''-(-)-*-+-,---.-/-0-1-2-3-4-5-6-7-8-9-:-;-<-=->-?-@-A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z-[-\\-]-^-_-`-a-b-c-d-e-f-g-h-i-j-k-l-m-n-o-p-q-r-s-t-u-v-w-x-y-z-{-|-}-~--Р‚-Рѓ-‚-С“-„-…-вЂ
-‡-€-‰-Р‰-‹-РЉ-РЊ-Р‹-РЏ-С’-вЂ-’-“-”-•-–-—-В-в„ў-С™-›-Сљ-Сњ-С›-Сџ-В
-РЋ-Сћ-Р€-В¤-Тђ-В¦-В§-РЃ-В©-Р„-В«-В¬-В-В®-Р‡-В°-В±-Р†-С–-Т‘-Вµ-В¶-В·-С‘-в„–-С”-В»-С-Р…-С•-С—-Рђ-Р‘-Р’-Р“-Р”-Р•-Р–-Р—-Р-Р™-Рљ-Р›-Рњ-Рќ-Рћ-Рџ-Р
-РЎ-Рў-РЈ-Р¤-РҐ-Р¦-Р§-РЁ-Р©-РЄ-Р«-Р¬-Р-Р®-РЇ-Р°-Р±-РІ-Рі-Рґ-Рµ-Р¶-Р·-Рё-Р№-Рє-Р»-Рј-РЅ-Рѕ-Рї-СЂ-СЃ-С‚-Сѓ-С„-С…-С†-С‡-С€-С‰-СЉ-С‹-СЊ-СЌ-СЋ-СЏ--------
It looks like you are passing wide string as the first parameter. You
can post here your code, where you prepare this string before placing it
into the inbound buffer. More simple way to confirm this version -
replace SQL_C_CHAR with SQL_C_WCHAR in SQLBindParameters.
And of course you can try other PostgreSQL ODBC drivers, for example:
https://projects.commandprompt.com/public/odbcng/wiki/Downloads
Zubkovsky, Sergey wrote:
> Sorry, I forgot to attach the log file.
>
> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Zubkovsky, Sergey
> Sent: Tuesday, July 24, 2007 3:37 PM
> To: Andrei Kovalevski
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Varchar parameter conversion
>
> Hello,
>
> Thank you for your answer!
> But this is the same what I do exactly.
>
> I have realized the stored procedure call with a varchar parameter value
> which originally contained characters with the ASC-codes from 1 to 255.
> For visualization purpose all these chars were separated by char '-'.
>
> A log file was produced by the ODBC driver is attached.
>
> Look at the "GetPartitionName_sp" stored procedure call.
> I suppose that the first parameter was converted to UTF-8.
> But I didn't do this conversion!
>
>
> -----Original Message-----
> From: Andrei Kovalevski [mailto:andyk@commandprompt.com]
> Sent: Monday, July 23, 2007 6:41 PM
> To: Zubkovsky, Sergey
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Varchar parameter conversion
>
> 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.
>>
Andrei.
view thread (5+ messages)
Message-ID: <46A6034B.5090505@commandprompt.com>
Permalink: ../46A6034B.5090505@commandprompt.com/
Also on: postgresql.org/message-id/46A6034B.5090505@commandprompt.com
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: andyk@commandprompt.com, Sergey.Zubkovsky@transas.com
Subject: Re: FW: Varchar parameter conversion
In-Reply-To: <46A6034B.5090505@commandprompt.com>
References: <528853D3C5ED2C4AA8990B504BA7FB850106DDE6@sol.transas.com> <46A6034B.5090505@commandprompt.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox