Subject column list & variable list do not match
Author Ryan Nilsson-Harding
Hi,

I have a query using a union which works fine with TIB_Query.
When I send the same query to my report, which uses a TIBQuery (using
QR) I get the error:

"Invalid command
count of column list and variable list do not match"

This error appears twice, then the report displays as expected.
Containing data from both queries...

Very confused & frustrated & I cannot find any logical reason for this
error.

My query is:

SELECT PT_ID AS ID, BOXNUM AS BOXNUM, REF AS REFNUM, C.NAME AS CLIENT
FROM PTI P
LEFT JOIN CLIENTS C ON (P.CL_ID=C.CL_ID)
WHERE BOXNUM LIKE '%MMSF%'
UNION
SELECT BD_ID AS ID, BOXNUM AS BOXNUM, REF AS REFNUM, C.NAME AS CLIENT
FROM BDOWN B
LEFT JOIN CLIENTS C AS (B.CL_ID=C.CL_ID)
WHERE BOXNUM LIKE '%MMSF%'

So, why does this error occur at all if my two sets of columns are
identical AND the resultant set is valid after the error?

It appears to be a TIBQuery problem (as opposed to a TIB_Query).
Both queries produce no error when done individually.

Any ideas?