| From: | "A(dot)j(dot) Langereis" <a(dot)j(dot)langereis(at)inter(dot)nl(dot)net> | 
|---|---|
| To: | <pgsql-odbc(at)postgresql(dot)org> | 
| Subject: | Values in the select | 
| Date: | 2005-12-22 22:47:50 | 
| Message-ID: | 001401c60749$bd1ab910$6500a8c0@aarjan2 | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-odbc | 
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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | noreply | 2005-12-23 09:35:49 | [ psqlodbc-Bugs-1000498 ] rollback to savepoint in case of error | 
| Previous Message | noreply | 2005-12-22 18:57:19 | [ psqlodbc-Bugs-1000498 ] rollback to savepoint in case of error |