Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-interfaces by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group