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 1EF499DC81F for ; Sat, 24 Dec 2005 00:12:57 -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 46116-05 for ; Sat, 24 Dec 2005 00:12:55 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from gk-us2.us.michelin.com (gk-us2.michelin.com [156.65.14.19]) by postgresql.org (Postfix) with ESMTP id 5D59C9DCC81 for ; Sat, 24 Dec 2005 00:12:53 -0400 (AST) Received: from oncpfxp4-out.onc.michelin.com (unverified [10.21.4.32]) by gk-us2.us.michelin.com (Clearswift SMTPRS 5.1.7) with ESMTP id for ; Fri, 23 Dec 2005 23:12:03 -0500 Received: from ONCMH1.onc.michelin.com (ONCMH1.onc.michelin.com [156.65.124.40]) by oncpfxp4-out.onc.michelin.com (Postfix) with ESMTP id C4A1C174FC for ; Fri, 23 Dec 2005 23:06:31 -0500 (EST) Received: from oncmtap1.onc.michelin.com by oncmh1.onc.michelin.com with ESMTP for pgsql-odbc@postgresql.org; Fri, 23 Dec 2005 23:06:31 -0500 Received: from oncems01.onc.michelin.com ([156.65.125.150]) by oncmtap1.onc.michelin.com (Netscape Messaging Server 4.15) with ESMTP id IRZI1Q00.K6D for ; Fri, 23 Dec 2005 23:05:50 -0500 Received: from [10.36.138.5] (unverified) by oncems01.onc.michelin.com (Content Technologies SMTPRS 4.2.5) with ESMTP id ; Fri, 23 Dec 2005 23:05:49 -0500 Message-Id: <43ACC919.6080609@us.michelin.com> Date: Fri, 23 Dec 2005 23:05:45 -0500 From: "Campbell, Greg" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "A.j. Langereis" CC: pgsql-odbc@postgresql.org Subject: Re: Values in the select References: <001401c60749$bd1ab910$6500a8c0@aarjan2> In-Reply-To: <001401c60749$bd1ab910$6500a8c0@aarjan2> Content-Type: multipart/mixed; boundary="------------030203020905090603080407" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=2.107 required=5 tests=[AWL=-0.045, RCVD_IN_WHOIS_INVALID=2.151, UNPARSEABLE_RELAY=0.001] X-Spam-Score: 2.107 X-Spam-Level: ** X-Archive-Number: 200512/312 X-Sequence-Number: 6791 This is a multi-part message in MIME format. --------------030203020905090603080407 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Nice sample. Perhaps you can use a DSN connection and in the PostgreSQL ODBC Driver setup for the connection turn on mylog. Or you can use the ODBC Administrator, under the tracing tab, Start Tracing. Or in the server postgresql.conf temporarily turn the logging on for all statements, to capture lower level ODBC communication. Do the ODBC connection encoding, and the database encoding match? A.j. Langereis wrote: > 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 := TADOQuery.create(nil); > qry.Connection:=conn; > qry.SQL.Text:= 'select ''bar'' as foo'; > > qry.Open; > > if not qry.eof then > begin > datasource := TDataSource.Create(nil); > datasource.dataset := 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 --------------030203020905090603080407 Content-Type: text/x-vcard; charset=utf-8; name="greg.campbell.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="greg.campbell.vcf" begin:vcard fn:Greg Campbell n:Campbell;Greg org:Michelin North America - US5 Lexington;ENG-ASE email;internet:greg.campbell@us.michelin.com title:ASE Systems Engineer tel;work:803-951-5561/x75561 x-mozilla-html:FALSE version:2.1 end:vcard --------------030203020905090603080407--