X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 599089DC88B for ; Thu, 22 Dec 2005 18:48:36 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 69193-08 for ; Thu, 22 Dec 2005 18:48:38 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from altrade.nijmegen.internl.net (altrade.nijmegen.internl.net [217.149.192.18]) by postgresql.org (Postfix) with ESMTP id BB36F9DC837 for ; Thu, 22 Dec 2005 18:48:32 -0400 (AST) Received: from aarjan2 by altrade.nijmegen.internl.net via 82-202.surfsnel.dsl.internl.net [145.99.202.82] with ESMTP for id jBMMmWbh015275 (8.13.2/2.04); Thu, 22 Dec 2005 23:48:33 +0100 (MET) Message-ID: <001401c60749$bd1ab910$6500a8c0@aarjan2> From: "A.j. Langereis" To: Subject: Values in the select Date: Thu, 22 Dec 2005 23:47:50 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0011_01C60752.1E697BE0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.002 required=5 tests=[AWL=-0.000, HTML_MESSAGE=0.001, UNPARSEABLE_RELAY=0.001] X-Spam-Score: 0.002 X-Spam-Level: X-Archive-Number: 200512/300 X-Sequence-Number: 6779 This is a multi-part message in MIME format. ------=_NextPart_000_0011_01C60752.1E697BE0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Dear all, I have written an application that uses Postgresql (8.1.0) trough an = ODBC (ANSI) connection. I noticed that a query like "select 'bar' as = foo" does not give the value "bar" in the column "foo". This works = normally under PGadmin and even on other databases via ODBC. Am I = overlooking something or might this be a bug? Values that I do get are like "#0#0#0#0#0" A piece of Delphi code to show the problem: procedure show_problem(conn : TADOConnection) var qry : TAdoQuery; datasource: TDataSource; begin qry :=3D TADOQuery.create(nil); qry.Connection:=3Dconn; qry.SQL.Text:=3D 'select ''bar'' as foo'; =20 qry.Open; if not qry.eof then begin datasource :=3D TDataSource.Create(nil); datasource.dataset :=3D qry; //datasource.DataSet.Fields[1].AsString now has the value of = '#0#0#0#0#0' //datasource.DataSet.Fields[1].FieldName is now equal to 'foo' datasource.free; end; qry.close; qry.free; end; The version of ODBC that I've got installed is 08.00.0102 (via MSI = installed). Yours, Aarjan ------=_NextPart_000_0011_01C60752.1E697BE0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Dear all,
 
I have written an application that uses = Postgresql=20 (8.1.0) trough an ODBC (ANSI) connection. I=20 noticed that a query like "select 'bar' as foo" does not give the value = "bar" in=20 the column "foo". This works normally under PGadmin and even on other = databases=20 via ODBC. Am I overlooking something or might this be a = bug?
 
Values that I do get are like=20 "#0#0#0#0#0"
 
A piece of Delphi code to show the=20 problem:
 
procedure show_problem(conn :=20 TADOConnection)
var
    qry : = TAdoQuery;
    datasource:=20 TDataSource;
begin
    qry :=3D=20 TADOQuery.create(nil);
   =20 qry.Connection:=3Dconn;
    qry.SQL.Text:=3D = 'select ''bar'' as foo';
   
    = qry.Open;
 
    if not qry.eof = then
       =20 begin
       =20 datasource :=3D TDataSource.Create(nil);
       =20 datasource.dataset :=3D qry;
 
       =20 //datasource.DataSet.Fields[1].AsString now has the value=20 of '#0#0#0#0#0'
       =20 //datasource.DataSet.Fields[1].FieldName is now equal to = 'foo'
 
       =20 datasource.free;
       =20 end;
 
    = qry.close;
    = qry.free;
end;
 
The version of ODBC that I've got = installed is=20 08.00.0102 (via MSI installed).
 
Yours,
 
Aarjan
------=_NextPart_000_0011_01C60752.1E697BE0--