Subject Re: [IBO] How to access field when there are dupe field names
Author Lester Caine
Eyal wrote:

> How do I access the correct field when there are several fields with
> the same name?
SELECT aaa.num,, ppp.num AS pnum, ppp.mod_date

> 2. I tried to be clever and use the fully qualified name -
> query['aaa.num']:=... only to discover that IBO ignores the table name
> and only uses the field name.
> Is this a bug or an intended behavior? Is there any way to access
> fields using the fully qualified name?
Since the query returns a single set of results, you need a single set
of unqualified names to define them. IBO normally adds COLUMN3 if a
field name is duplicated.

> A possible solution is to use aliases for all fields, but this makes
> query building very cumbersome, and really pointless as "table name +
> field name" already provides a unique identifier.
The correct method is either to create inserts direct to the underlying
tables, or work with aliases. In SQL you can't insert into two tables at
the same time, so IBO has to convert things to actually work, which is
another reason that unique field names are needed.

Lester Caine
L.S.Caine Electronic Services