Skip site navigation (1) Skip section navigation (2)

Re: Varchar parameter conversion

From: Andrei Kovalevski <andyk(at)commandprompt(dot)com>
To: "Zubkovsky, Sergey" <Sergey(dot)Zubkovsky(at)transas(dot)com>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Varchar parameter conversion
Date: 2007-07-23 14:40:59
Message-ID: 46A4BDFB.1080202@commandprompt.com (view raw or flat)
Thread:
Lists: pgsql-odbc
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.
>


In response to

Responses

pgsql-odbc by date

Next:From: Zubkovsky, SergeyDate: 2007-07-24 11:37:27
Subject: Re: Varchar parameter conversion
Previous:From: Zubkovsky, SergeyDate: 2007-07-23 13:43:25
Subject: Varchar parameter conversion

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group