Subject Re: [IBO] TIBOQuery and RecordCount
Author Daniel Rail
Hi,

At July 20, 2004, 19:55, Robert martin wrote:

> I have noticed that with a TIBOQuery the recordcount property
> causes an error (Count of column list and variable list do not
> match) when the source SQL contains a UNION. Is this a known error
> or am I doing something wrong?

The Firebird's API doesn't return the number of rows affected by a DML
statement.

So, IBO does a SELECT COUNT(*) when doing a record count, if
RecordCountAccurate is True. IBO simply takes the same FROM and
WHERE clauses from your query to perform the SELECT COUNT(*).

So, the question becomes: How can you do a SELECT COUNT(*) when the
query contains one or more UNION?

The only way this would be possible is by doing the following:
SELECT COUNT(*) FROM (SubQuery containing UNION)
This isn't possible with the current versions of Firebird, but it will
be possible with FB 2.0.

--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)