Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.

Welcome, Guest
Guest Settings

Thread: Firebid: RecordCount and order fields exception

Permlink Replies: 0 Threads: [ Previous | Next ]
ivan ivanov

Posts: 8
Registered: 2/13/13
Firebid: RecordCount and order fields exception
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 27, 2016 3:23 AM
If anyone has order field in your query, then line as Query1-> RecordCount will not work with Firebird. Under debug firebird aggregate related exception occurs. The reason is hidden in the file:
function countSQL($sql)
      // TODO: improve this to not be "select *" dependent
      //return str_ireplace("select *", "select count(*)", $sql); //causes aggregate firebird errors if there are any order field
      return  "select count(*)  from (select * from (" . $sql . ")  ) "; //my current replacement

This is because there are not any group by when select count(*) and order by are used in original line. If anyone know better solution, share please.
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02