Subject Re: [IBO] Actual field names
Author russellbelding
Thanks Set. The users of the scripts know only a little SQL so I am
trying to keet their sql script requirements as simple as possible.
Luc has pointed me to GetFieldNames(list) and thats what I have been
looking for.
Russell

--- In IBObjects@yahoogroups.com, Svein Erling Tysvaer
<svein.erling.tysvaer@...> wrote:
>
> russellbelding wrote:
> > I have an "SQL script presenter" that presents in a TIB_GRID the
data
> > arriving from an SQL script fed to a TIB_QUERY. I want to allow
the
> > grid columns to be ordered by clicking on the column titles.
> >
> > Using a script like "select field01 from table" there is no
problem. I
> > use grid.gridFields to get fields names like "field01" and feed
these
> > into the ordering properties of the query.
> >
> > Using a script like "select field01 as alias01 from table",
> > I need "field01" for the query ordering properties. So far I can
> > find "alias01" and have not found "field01". Any suggestions as
to how
> > to find "field01" from the existing grid or query properties or
> > methods?
> > Thanks
>
> What you can do regardless of whether it is a field name, alias or
> calculated column, is to order by position. E.g. "select field01
as
> alias01 from table order by 1" works flawless.
>
> Moreover, IBO has lots of Ordering... properties that could
probably do
> whatever you need to do without much programming on your part.
>
> HTH,
> Set
>