Getting field expression for aliased fields

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sasa.pikija
Posts: 3
Joined: Fri 01 Feb 2019 14:44

Getting field expression for aliased fields

Post by sasa.pikija » Mon 20 May 2019 07:51

Is it possible to get field "Expression" from SQL query with Unidac for fields that have AS ...? (Oracle, PostgreSQL, Firebird)

For example:
SELECT CASE WHEN State='F' THEN 'Foreign' ELSE ' Domestic' END AS StateText, Substr(Name,1,20) AS PartOfName FROM <SomeTable>

When I read field names i got: StateText and PartOfName.
I would like to get text for aliased field:
1. for StateText : CASE WHEN State='F' THEN 'Foreign' ELSE ' Domestic' END
2. for PartOfName : Substr(Name,1,20)

Thanks.

MaximG
Devart Team
Posts: 1822
Joined: Mon 06 Jul 2015 11:34

Re: Getting field expression for aliased fields

Post by MaximG » Tue 21 May 2019 08:43

The discussed functionality is not related to the behavior of our products. The syntactic analysis of an SQL query is conducted on your DB server and the possibility of getting the required expression is defined by your server.

Post Reply