Subject Re: duplicate field names
From Edgar Borger <eborger@terra.com.br>
Date Thu, 31 Jan 2019 11:32:08 -0200
Newsgroups sqlexpress

found it !

use fieldname AS xxx in select.

oFat := xDataSet():New("SELECT p.no_ped, p.dspdat, p.cliente, p.fase, p.natureza, p.descn AS pdescn, i.*, c.codigo, c.raz_soc, c.fantasia ;

Regards,
Edgar

Em 31/01/2019 10:46, Edgar Borger escreveu:
> Hello,
>
> I have this :
>
> oFat := xDataSet():New("SELECT p.no_ped, p.dspdat, p.cliente, p.fase, p.natureza, p.descn, i.*, c.codigo, c.raz_soc, c.fantasia ;
>          FROM pedicab p, pedidos i, cliente c WHERE" + cWhe + " ORDER by c.raz_soc,p.no_ped,p.dspdat" , oConnection)
> oFat:Execute()
>
> there is a field in table pedicab called "descn", and there is another field in table pedidos also called "descn", so in my resulting dataset I have 2
> fields with the same name, if I do oFat:FieldGet( "descn" ), is there a way to chose which one ?
>
> could I do
> oFat:FieldGet("p.descn")
> and
> oFat:FieldGet("i.descn")
>
> apart from using the field number, is there some other way of getting the correct field ?
>
>
> Thanks,
> Edgar
>
>
>
>


--
Edgar Borger
Softsupply Informatica Ltda.
Rua Alagoas, 48
Sao Paulo, SP
01242-000
Tel   : (5511) 3159-1997
Email : softsupply@terra.com.br

Recent messages in this thread
 
-# duplicate field names Edgar Borger 31-Jan-2019 07:46 am
.\# Re: duplicate field names (Current message) Edgar Borger 31-Jan-2019 08:32 am