pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem with simple SELECT over ODBC
3+ messages / 3 participants
[nested] [flat]

* Problem with simple SELECT over ODBC
@ 2010-09-03 09:00 Werner Kuhnle <wek@kuhnle.com>
  2010-09-03 14:35 ` Re: Problem with simple SELECT over ODBC Tom Lane <tgl@sss.pgh.pa.us>
  2010-09-03 21:53 ` Re: Problem with simple SELECT over ODBC Hiroshi Inoue <inoue@tpf.co.jp>
  0 siblings, 2 replies; 3+ messages in thread

From: Werner Kuhnle @ 2010-09-03 09:00 UTC (permalink / raw)
  To: pgsql-odbc

Hello,

I am completely new to PostgreSQL and wanted to evaluate PostgreSQL as a substitute for MS SQL.
Therefore I installed PG 9 RC and ODBC driver 8.04.02 (ANSI)
The program (EXE) calling the ODBC driver (Windows 32bit written in VC++) is using ANSI strings, not Unicode.

When I try the following simple SELECT :

SELECT Kurzzeichen,Name_Feld,EURO_Umr_Faktor,NKStellen,RowTimestamp,RowUserID,RowDDMFields,RowID FROM Waehrungen ORDER BY Kurzzeichen
 
from within pgAdminIII then it works well.

When I use exactly the same query with MS SQL and the SQL Server Native Client 10.0 ODBC Driver
it also works well.

But when exactly the same SELECT is issued to PG over the PG ODBC driver then I get :

SQLRetcode=-1
SqlState=42601, NativeError=7, MessageText=ERROR; syntax error at »,«;
 
Playing around some time with ENCODING=WIN1252 instead of UTF-8 and trying the UNICODE odbc driver instead of the ANSI driver gives the following results:

With the UNICODE driver the message does not occur, but the data returned is completely corrupted.

With ENCODING=WIN1252 the message is slightly different:
SQLRetcode=-1
SqlState=42601, NativeError=7, MessageText=ERROR; syntax error at »,«;
 
What's wrong here ?

Thanks in advance for any help/hint.

Greetings

Werner

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Problem with simple SELECT over ODBC
  2010-09-03 09:00 Problem with simple SELECT over ODBC Werner Kuhnle <wek@kuhnle.com>
@ 2010-09-03 14:35 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2010-09-03 14:35 UTC (permalink / raw)
  To: Werner Kuhnle <wek@kuhnle.com>; +Cc: pgsql-odbc

"Werner Kuhnle" <wek@kuhnle.com> writes:
> But when exactly the same SELECT is issued to PG over the PG ODBC driver then I get :

> SQLRetcode=-1
> SqlState=42601, NativeError=7, MessageText=ERROR; syntax error at »,«;
 
> Playing around some time with ENCODING=WIN1252 instead of UTF-8 and trying the UNICODE odbc driver instead of the ANSI driver gives the following results:

> With the UNICODE driver the message does not occur, but the data returned is completely corrupted.

> With ENCODING=WIN1252 the message is slightly different:
> SQLRetcode=-1
> SqlState=42601, NativeError=7, MessageText=ERROR; syntax error at »,«;
 
> What's wrong here ?

No idea, but the first thing I'd try is looking into the server's log to
see what it thought the received query was.  Anything that generates an
error would be logged by default.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Problem with simple SELECT over ODBC
  2010-09-03 09:00 Problem with simple SELECT over ODBC Werner Kuhnle <wek@kuhnle.com>
@ 2010-09-03 21:53 ` Hiroshi Inoue <inoue@tpf.co.jp>
  1 sibling, 0 replies; 3+ messages in thread

From: Hiroshi Inoue @ 2010-09-03 21:53 UTC (permalink / raw)
  To: Werner Kuhnle <wek@kuhnle.com>; +Cc: pgsql-odbc

(2010/09/03 18:00), Werner Kuhnle wrote:
>
> Hello,
> I am completely new to PostgreSQL and wanted to evaluate PostgreSQL as a
> substitute for MS SQL.
> Therefore I installed PG 9 RC and ODBC driver 8.04.02 (ANSI)
> The program (EXE) calling the ODBC driver (Windows 32bit written in
> VC++) is using ANSI strings, not Unicode.
> When I try the following simple SELECT :
> SELECT
> Kurzzeichen,Name_Feld,EURO_Umr_Faktor,NKStellen,RowTimestamp,RowUserID,RowDDMFields,RowID
> FROM Waehrungen ORDER BY Kurzzeichen
> from within pgAdminIII then it works well.
> When I use exactly the same query with MS SQL and the SQL Server Native
> Client 10.0 ODBC Driver
> it also works well.
> But when exactly the same SELECT is issued to PG over the PG ODBC driver
> then I get :
>
> SQLRetcode=-1
> SqlState=42601, NativeError=7, MessageText=ERROR; syntax error at »,«;

Could you send me directly the Mylog output?

> Playing around some time with ENCODING=WIN1252 instead of UTF-8 and
> trying the UNICODE odbc driver instead of the ANSI driver gives the
> following results:
> With the UNICODE driver the message does not occur, but the data
> returned is completely corrupted.

What do you mean by "corrupted"?
The Unicode driver returns the results in UTF16 strings.

regards,
Hiroshi Inoue



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2010-09-03 21:53 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-09-03 09:00 Problem with simple SELECT over ODBC Werner Kuhnle <wek@kuhnle.com>
2010-09-03 14:35 ` Tom Lane <tgl@sss.pgh.pa.us>
2010-09-03 21:53 ` Hiroshi Inoue <inoue@tpf.co.jp>

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