Re: C++: headache with PgDatabase::GetValue (int, - Mailing list pgsql-interfaces

From Peter Eisentraut
Subject Re: C++: headache with PgDatabase::GetValue (int,
Date
Msg-id Pine.LNX.4.30.0202171615500.683-100000@peter.localdomain
Whole thread Raw
In response to C++: headache with PgDatabase::GetValue (int, string)  ("Carlos Moreno" <moreno@mochima.com>)
List pgsql-interfaces
Carlos Moreno writes:

> Say I have two unrelated tables with fields witht the same name
> (e.g., table Employees, with a field Name, and table Departments,
> also with a field Name).  I have a SELECT statement that returns
> data from both tables, and I need both Name fields:
>
>     "select Emp.Name, Dept.Name from Emp, Dept where ....... "
>
> Now, I (obviously) want to use GetValue (row, "field_name") to
> get the values.

You must use AS clauses to give the two fields different output names.

-- 
Peter Eisentraut   peter_e@gmx.net



pgsql-interfaces by date:

Previous
From: "Carlos Moreno"
Date:
Subject: C++: headache with PgDatabase::GetValue (int, string)
Next
From: Hiroshi Inoue
Date:
Subject: Re: odbc on unix