Subject | Re: [IBO] FieldByName with table alias |
---|---|
Author | Boris Schlüszler |
Post date | 2002-08-23T15:48:44Z |
Hi Jason!
Is it true, that TableName returns the name of the source table and not
of the alias from the query?
Hence:
select * from bla customers
TableName returns "bla", and not "customers".
This gets problematic, if fields with same name are to be picked via
FieldByName...
I set up my own x-ref-list: TableAlias+FieldName->FieldIndex.
I feel, this is much effort for an easy thing...
Regards, Boris
Jason Wharton schrieb:
Boris Schlueszler - TS Autovermietung
Tel.: (05865) 9881-13, Fax: (05865) 1381
http://gusborn.ts-autovermietung.de
Hier mieten Sie glückliche Autos!
Is it true, that TableName returns the name of the source table and not
of the alias from the query?
Hence:
select * from bla customers
TableName returns "bla", and not "customers".
This gets problematic, if fields with same name are to be picked via
FieldByName...
I set up my own x-ref-list: TableAlias+FieldName->FieldIndex.
I feel, this is much effort for an easy thing...
Regards, Boris
Jason Wharton schrieb:
>--
> What does the FullFieldName of the Fields[n] objects say?
> I use table names.
>
> Jason Wharton
> CPS - Mesa AZ
> http://www.ibobjects.com
>
> -- We may not have it all together --
> -- But together we have it all --
>
> ----- Original Message -----
> From: "Boris Schlüszler" <boris@...>
> Newsgroups: egroups.ibobjects
> To: <IBObjects@yahoogroups.com>
> Sent: Friday, August 23, 2002 12: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
> >
> >
> >
> ___________________________________________________________________________
> > IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> > without the need for BDE, ODBC or any other layer.
> >
> ___________________________________________________________________________
> > http://www.ibobjects.com - your IBO community resource for Tech Info
> papers,
> > keyword-searchable FAQ, community code contributions and more !
> >
> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> >
> >
> >
>
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info papers,
> keyword-searchable FAQ, community code contributions and more !
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Boris Schlueszler - TS Autovermietung
Tel.: (05865) 9881-13, Fax: (05865) 1381
http://gusborn.ts-autovermietung.de
Hier mieten Sie glückliche Autos!