Re: FieldByRealName

From: Vitali Kalinin (vitkalinin_at_yahoo.com)
Date: 01/24/05


Date: Mon, 24 Jan 2005 17:45:34 +0200

Ado Field object has dynamic properties named "BASETABLENAME" and
"BASECOLUMNNAME". I believe that
is exactly what you are looking for. Hovewer I am not sure that this
property will be exposed by all providers.

"Sergey Amanov" <a@a.com> сообщил/сообщила в новостях следующее:
news:41f50fb7@newsgroups.borland.com...
> Ray thanks for your answer.
> In effect I don't know alias name, I know only real name because I read
sql
> from Db. 'REAL_FIELD_NAME' must be used in sql but 'FIELD_ALIAS_NAME' can
be
> changed by user.
>
> "Ray Marron" <me@privacy.net> wrote in message
> news:41f5078a$1@newsgroups.borland.com...
> > "Sergey Amanov" <a@a.com> wrote in message
> > news:41f50638@newsgroups.borland.com...
> >> Hi,
> >>
> >> Is there any way to call field REAL name when using alias?
> >>
> >> Ex:
> >> ADOQuery1.Sql.Text := 'SELECT REAL_FIELD_NAME ''FIELD_ALIAS_NAME'' FROM
> >> TABLE_NAME';
> >> ADOQuery1.Open;
> >>
> >> ADOQuery1.FieldByName('FIELD_ALIAS_NAME').AsString; //no error
> >> ADOQuery1.FieldByName('REAL_FIELD_NAME).AsString; //run time error
but
> >> I
> >> want to call this
> >
> > I don't think you can do this, as the dataset has only one field and it
is
> > known by the alias. You could include the field a second time under the
> > original name, but that seems wasteful. I take it the SQL query is not
> > under your control? If you're building it yourself, you already know
the
> > real/alias names and should be able to convert fairly easily.
> >
> > --
> > Ray Marron
> >
> >
>
>



Relevant Pages

  • Re: See the structure of what I am pulling via DBI
    ... > sure how to see the arrayref. ... if you know the field name or its alias you can use $sth->fetchrow_hashref ... and you have access to the sql query ...
    (perl.beginners)
  • Re: fetching boolean value from sql query result
    ... fetching the field values? ... DataReaderbut this field number could so easily change if the ... sql query is changed and ... ... > Please do not send e-mail directly to this alias. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SQL query: how can I hide a column in output?
    ... I've the following SQL query: ... Actually, I need the alias client_no for further processing, but I ... You are not required to show that column, but your SELECT clause needs to show at least one column. ... If you are writing your own application, you do not have to display the column's value in that application if you do not want to. ...
    (comp.databases.oracle.server)
  • Re: FieldByRealName
    ... "Sergey Amanov" wrote in message ... > Is there any way to call field REAL name when using alias? ... real/alias names and should be able to convert fairly easily. ... Ray Marron ...
    (borland.public.delphi.database.ado)