Page 1 of 1

Problem with QueryRecCount option of TIBCQuery

Posted: Wed 03 Feb 2010 15:14
by tsteinmaurer
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

Posted: Thu 04 Feb 2010 12:12
by Challenger
Please try to add aliases to the SUM(T.NUMBER_OF_READS), SUM(T.NUMBER_OF_FETCHES) columns.

Posted: Thu 04 Feb 2010 13:11
by tsteinmaurer
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