Subject | Re: [IBO] FieldByName with table alias |
---|---|
Author | Luiz |
Post date | 2002-08-23T11:47:20Z |
Boris,
I think that in your case, you must list explictly your fields in the select
clause and to use an alias to fields existing in both tables, such as IBO
can identify them. It´s necessary because you have fields with the same name
in both tables.
Luiz.
I think that in your case, you must list explictly your fields in the select
clause and to use an alias to fields existing in both tables, such as IBO
can identify them. It´s necessary because you have fields with the same name
in both tables.
Luiz.
----- Original Message -----
From: "Boris Schlüszler" <boris@...>
Newsgroups: egroups.ibobjects
To: <IBObjects@yahoogroups.com>
Sent: Friday, August 23, 2002 4:57 AM
Subject: Re: [IBO] FieldByName with table alias
> Hi Helen!
>
> Helen Borrie schrieb:
> >
> > At 12:48 AM 23-08-02 +0200, you wrote:
> > >Hi!
> > >
> > >select * from table customer
> > >left join table copyto on copyto.id=:copyto
> > >left join table secondcopy on secondcopy.id=:secondcopy
> >
> > This syntax won't work.
>
> The SQL query works perfectly well.
> My problem is, that I can't access the result set from IBO because I
> can't uniquely name the columns (I could get them via index [] however).
>
> Say, in table are two fields:
>
> ID integer
> NAME char(40)
>
> The above query results (FullFieldNames):
>
> TABLE.ID (customer)
> TABLE.NAME (customer)
> TABLE.ID (copyto)
> TABLE.NAME (copyto)
> TABLE.ID (secondcopy)
> TABLE.NAME (secondcopy)
>
> The table aliases (customer, copyto, and secondcopy) are not interpreted
> by IBO.
> I don't want to use FieldIndexes. So, how can I access "copyto.NAME"
> from IBO?
> With ParamByName('ID').AsString I will get customer.ID and not
> copyto.ID.
>
> Regards, Boris