Re: C++: headache with PgDatabase::GetValue (int,

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Carlos Moreno <moreno(at)mochima(dot)com>
Cc: <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: C++: headache with PgDatabase::GetValue (int,
Date: 2002-02-17 21:16:25
Message-ID: Pine.LNX.4.30.0202171615500.683-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)net

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2002-02-17 21:21:41 Re: C++: headache with PgDatabase::GetValue (int, string)
Previous Message Carlos Moreno 2002-02-17 20:52:31 C++: headache with PgDatabase::GetValue (int, string)