Problem with simple SELECT over ODBC

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_0001DB25.4C80D55D
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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,RowD=
DMFields,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=3D-1
SqlState=3D42601, NativeError=3D7, MessageText=3DERROR; syntax error at =
=BB,=AB;

Playing around some time with ENCODING=3DWIN1252 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=3DWIN1252 the message is slightly different:
SQLRetcode=3D-1
SqlState=3D42601, NativeError=3D7, MessageText=3DERROR; syntax error at =
=C2=BB,=C2=AB;

What's wrong here ?

Thanks in advance for any help/hint.

Greetings

Werner

------_=_NextPart_000_0001DB25.4C80D55D
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!CURSOR TABLEDIV><HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META name=3DGENERATOR content=3D"MSHTML 8.00.7600.16625"></HEAD>
<BODY style=3D"FONT-FAMILY: Tahoma,Arial; COLOR: #000000; FONT-SIZE: 10pt" =

leftMargin=3D5 topMargin=3D5 bgColor=3D#e5e5e5>
<TABLE
style=3D"Z-INDEX: 2; POSITION: static; MARGIN-TOP: 17px; WIDTH: 500px; =
FONT-FAMILY: Tahoma,Arial; HEIGHT: 66px; MARGIN-LEFT: 12px; FONT-SIZE: =
10pt"
border=3D1 borderColor=3D#ffffff borderColorLight=3D#c0c0c0 =
borderColorDark=3D#c0c0c0
cellPadding=3D0 bgColor=3D#ffffff>
<TBODY>
<TR borderColorLight=3D#ffffff borderColorDark=3D#ffffff =
borderColor=3D#ffffff>
<TD
style=3D"PADDING-BOTTOM: 6px; LINE-HEIGHT: 130%; PADDING-LEFT: 7px; =
PADDING-RIGHT: 6px; VERTICAL-ALIGN: top; PADDING-TOP: 6px"
width=3D"100%">
<DIV id=3DTABLEDIV>
<DIV>Hello,</DIV>
<DIV> </DIV>
<DIV>I am completely new to PostgreSQL and wanted to =
evaluate
PostgreSQL as a substitute for MS SQL.</DIV>
<DIV>Therefore I installed PG 9 RC and ODBC driver 8.04.02 =

(ANSI)</DIV>
<DIV>The program (EXE) calling the ODBC driver (Windows 32bit =
written in
VC++) is using ANSI strings, not Unicode.</DIV>
<DIV> </DIV>
<DIV>When I try the following simple SELECT :</DIV>
<DIV> </DIV>
<DIV>SELECT
=
Kurzzeichen,Name_Feld,EURO_Umr_Faktor,NKStellen,RowTimestamp ,RowUserID,RowD=
DMFields,RowID
FROM Waehrungen ORDER BY Kurzzeichen<BR> </DIV>
<DIV>from within pgAdminIII then it works well.</DIV>
<DIV> </DIV>
<DIV>When I use exactly the same query with MS SQL and the SQL =
Server
Native Client 10.0 ODBC Driver</DIV>
<DIV>it also works well.</DIV>
<DIV> </DIV>
<DIV>But when exactly the same SELECT is issued to PG over the PG =
ODBC
driver then I get :</DIV>
<DIV><BR>SQLRetcode=3D-1<BR>SqlState=3D42601, NativeError=3D7,
MessageText=3DERROR; syntax error at =BB,=AB;<BR> </DIV>
<DIV>Playing around some time with ENCODING=3DWIN1252 instead of =
UTF-8 and
trying the UNICODE odbc driver instead of the ANSI driver gives the =

following results:</DIV>
<DIV> </DIV>
<DIV>With the UNICODE driver the message does not occur, but the =
data
returned is completely corrupted.</DIV>
<DIV> </DIV>
<DIV>With ENCODING=3DWIN1252 the message is slightly =
different:</DIV>
<DIV>SQLRetcode=3D-1<BR>SqlState=3D42601, NativeError=3D7, =
MessageText=3DERROR;
syntax error at =C2=BB,=C2=AB;<BR> </DIV>
<DIV>What's wrong here ?</DIV>
<DIV> </DIV>
<DIV>Thanks in advance for any help/hint.</DIV>
<DIV> </DIV>
<DIV>Greetings</DIV>
<DIV> </DIV>
<DIV>Werner</DIV>
=
<DIV> </DIV><BR> </DIV></TD></TR></TBODY></TABLE></BODY></HTML>

------_=_NextPart_000_0001DB25.4C80D55D--
Werner Kuhnle [ Fr, 03 September 2010 11:00 ] [ ID #2047183 ]

Re: Problem with simple SELECT over ODBC

"Werner Kuhnle" <wek [at] 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

--
Sent via pgsql-odbc mailing list (pgsql-odbc [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
Tom Lane [ Fr, 03 September 2010 16:35 ] [ ID #2047184 ]

Re: Problem with simple SELECT over 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 drive=
r
> then I get :
>
> SQLRetcode=3D-1
> SqlState=3D42601, NativeError=3D7, MessageText=3DERROR; syntax error at=
=BB,=AB;

Could you send me directly the Mylog output?

> Playing around some time with ENCODING=3DWIN1252 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

--
Sent via pgsql-odbc mailing list (pgsql-odbc [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
Hiroshi Inoue [ Fr, 03 September 2010 23:53 ] [ ID #2047187 ]
Datenbanken » gmane.comp.db.postgresql.odbc » Problem with simple SELECT over ODBC

Vorheriges Thema: Re-2: Problem with simple SELECT over ODBC
Nächstes Thema: pgsqlodbc utf8 windows?