Question 1: Finding the actual column name for an aliased field?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Question 1: Finding the actual column name for an aliased field?

Drew Jensen
Hi,

This has been interesting the last couple of days - even if it ends up
not helping folks directly - it sure helped me.

My question for this email.

I have a query:

SELECT "COL1" AS "ALIAS" FROM "TABLE"

Now I am handed a dataform in a routine and I need to find the column
names in the table, not the alias.

I thought that using the ResultsetColumn object and the properties

column.label = Alias
column.name = COL1

but no.

So am I just wrong on that?

Thanks

Drew

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Question 1: Finding the actual column name for an aliased field?

frank.schoenheit
Hi Drew,

> I have a query:
>
> SELECT "COL1" AS "ALIAS" FROM "TABLE"
>
> Now I am handed a dataform in a routine and I need to find the column
> names in the table, not the alias.

depending on which column object you have ... there might be a property
RealName, though I do not know, out of my head, at which col objects it
is available. So, try ControlModel.BoundField.RealName.

Ciao
Frank

--
- Frank Schönheit, Software Engineer         [hidden email] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Base                       http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Question 1: Finding the actual column name for an aliased field?

DrewJensen-2
On 2/9/2010 5:03 PM, Frank Schoenheit, Sun Microsystems Germany wrote:

> Hi Drew,
>
>> I have a query:
>>
>> SELECT "COL1" AS "ALIAS" FROM "TABLE"
>>
>> Now I am handed a dataform in a routine and I need to find the column
>> names in the table, not the alias.
>
> depending on which column object you have ... there might be a property
> RealName, though I do not know, out of my head, at which col objects it
> is available. So, try ControlModel.BoundField.RealName.
>


Nope - realname doesn't show up as a property for anything I can find.

That includes the query composer.

I thought there was a way to get this and realname sounds like it, but
its gone as far as I can see.

Drew

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Question 1: Finding the actual column name for an aliased field?

Ocke Janssen
Hi Drew,

Drew Jensen wrote:

> On 2/9/2010 5:03 PM, Frank Schoenheit, Sun Microsystems Germany wrote:
>> Hi Drew,
>>
>>> I have a query:
>>>
>>> SELECT "COL1" AS "ALIAS" FROM "TABLE"
>>>
>>> Now I am handed a dataform in a routine and I need to find the column
>>> names in the table, not the alias.
>>
>> depending on which column object you have ... there might be a property
>> RealName, though I do not know, out of my head, at which col objects it
>> is available. So, try ControlModel.BoundField.RealName.
>>
>
>
> Nope - realname doesn't show up as a property for anything I can find.
>
> That includes the query composer.
>
> I thought there was a way to get this and realname sounds like it, but
> its gone as far as I can see.
When you use the SingleSelectQueryCompser and ask for the SelectColumns
each column in that collection has a property RealName as well as a
TableName property.

 - oj
>
> Drew
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


--
Ocke Janssen                      Tel: +49 40 23646 661, x66661
Dipl. Inf(FH)                     Fax: +49 40 23646 550
Sun Microsystems Inc.
Nagelsweg 55                      mailto:[hidden email]
D-20097 Hamburg                   http://www.sun.com/staroffice

Sitz der Gesellschaft:
Sun Microsystems GmbH, Sonnenallee 1, D-85551 Kirchheim-Heimstetten
Amtsgericht Muenchen: HRB 161028
Geschaeftsfuehrer: Thomas Schroeder, Wolfgang Engels
Vorsitzender des Aufsichtsrates: Martin Haering


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]