Problem with QueryRecCount option of TIBCQuery

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tsteinmaurer
Posts: 52
Joined: Thu 17 Dec 2009 08:25

Problem with QueryRecCount option of TIBCQuery

Post by tsteinmaurer » Wed 03 Feb 2010 15:14

Hello,

I'm executing the following SQL statement against a Firebird 2.5 database:

Code: Select all

SELECT T.DATABASE_NAME, SUM(T.NUMBER_OF_READS), SUM(T.NUMBER_OF_FETCHES), cast (T.SQL_TEXT as varchar(1024)) sqltext ,  T.EVENT_NAME, count(*) sqlcount
FROM
    TRACE_DATA_PARSED T
where T.DATABASE_NAME is not null and T.SQL_TEXT is not null
GROUP BY T.DATABASE_NAME, sqltext, T.EVENT_NAME
order by sqlcount desc
The query executes fine when QueryRecCount is set to False, but fails when QueryRecCount is set to True. The problem seems to be the usage of field alias names in the GROUP BY clause.

Comments?


Thanks,
Thomas

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Thu 04 Feb 2010 12:12

Please try to add aliases to the SUM(T.NUMBER_OF_READS), SUM(T.NUMBER_OF_FETCHES) columns.

tsteinmaurer
Posts: 52
Joined: Thu 17 Dec 2009 08:25

Post by tsteinmaurer » Thu 04 Feb 2010 13:11

Hi!

The problem here is that a SQL statement can be entered by the user, so I can't influence what the user provides. The statement is a valid one so it can be executed with e.g. Firebird's isql command-line or Database Workbench etc.

Thomas

Post Reply