FilterSQL and aliased columns in queries

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
grexhide
Posts: 5
Joined: Sat 28 Apr 2007 11:52

FilterSQL and aliased columns in queries

Post by grexhide » Sat 28 Apr 2007 12:07

Act:

Code: Select all

SmartQuery1.SQL := 'SELECT OWNER SCHEMA, A.* FROM SYS.ALL_OBJECTS A';
SmartQuery1.FilterSQL := 'SCHEMA = ''SYS''';
SmartQuery1.Active := True;

ORA-00904: "SCHEMA: invalid identifier"

In a SQL Monitor ODAC seems to run following:

Code: Select all

SELECT OWNER SCHEMA, A.* FROM SYS.ALL_OBJECTS A
WHERE SCHEMA = 'SYS' /code]



[b]Expected: [/b]

In a case of FilterSQL, aliased columns and Oracle versions >= 9 FilterSQL must be act as following:

[code]SELECT * FROM
(
  SELECT OWNER SCHEMA, A.* FROM SYS.ALL_OBJECTS A
)
WHERE SCHEMA = 'SYS' 

Affected: all versions of ODAC

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Sat 28 Apr 2007 14:37

We'll consider possibility to implement the functionality that you have suggested, in either of the next ODAC versions.
For current ODAC version you should change the FilterSQL property to 'OWNER = ''SYS'''.

jfudickar
Posts: 202
Joined: Fri 10 Mar 2006 13:03
Location: Oberursel / Germany

Post by jfudickar » Sun 29 Apr 2007 10:32

I'm not shure if i like your suggestion.

It should be optional.

The current way is the default oracle way.

Greetings
Jens

Post Reply