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

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: moreno(at)mochima(dot)com
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: C++: headache with PgDatabase::GetValue (int, string)
Date: 2002-02-17 21:21:41
Message-ID: 24143.1013980901@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-interfaces
"Carlos Moreno" <moreno(at)mochima(dot)com> writes:
> 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. 

If you "obviously" want to use a fetch-by-name operation to fetch
fields, then it'd behoove you to name the columns differently in the
first place.  For example:

    select Emp.Name as emp_name, Dept.Name as dep_name from ...

			regards, tom lane

In response to

pgsql-interfaces by date

Next:From: Hiroshi InoueDate: 2002-02-18 00:36:16
Subject: Re: odbc on unix
Previous:From: Peter EisentrautDate: 2002-02-17 21:16:25
Subject: Re: C++: headache with PgDatabase::GetValue (int,

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