Subject Re: [IBO] column list & variable list do not match
Author Helen Borrie
At 05:21 AM 18/11/2004 +0000, you wrote:

>Jeez, wish I'd clambered upon that log earlier, just so I could fall
>off it!!
>
>I have just tried this though, and I'm getting the same error.
>I cleared out all the settings I had put into the reports TIBQuery,
>but still getting error.
>
>Sorry for not giving my environ. details. They are as follows:
>* Firebird server(Linux) & client(WinXP) 1.5.1.4481
>* IBO 4.3.Aa
>* IBX - Have never used IBX

If you are using TIBQuery then you are using IBX.

>* Dialect 3
>* My statement now is:
>
>The query on the form is qryTIB_q (of type TIB_Query)
>The query on the QReport is qryTIBq (of type TIBQuery)
>
>reportFm.qryTIBq.close;
>reportFm.qryTIBq.AssignSQLWithSearch(viewFm.qryTIB_q);
>reportFm.qryTIBq.Open;
>
>Like I stated earlier, the output ends up being what I want (same as
>form) but I'm still getting the error twice prior to displaying.

OK, try doing this in little steps.

Next thing to fix is your SQL (it's invalid for Fb 1.5) - corrections in
lower case:

SELECT
p.PT_ID AS ID,
p.BOXNUM AS BOXNUM,
p.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%' */
change this to
where p.boxnum containing 'MMSF'

UNION

SELECT
bd.BD_ID AS ID,
bd.BOXNUM AS BOXNUM,
bd.REF AS REFNUM,
C1.NAME AS CLIENT
FROM BDOWN B
LEFT JOIN CLIENTS /* C */ c1 /* invalid keyowrd here AS */
on (Bd.CL_ID=C1.CL_ID)
/* WHERE BOXNUM LIKE '%MMSF%' */
where bd.boxnum containing 'MMSF'


>I've checked out your book also, under the union sections (all be it
>briefly, very busy at the moment) and have found nothing relevant.

Let's see; but possibly what's relevant is that the output column names
and sizes are "set" by the first set in the union. No problem with the
names here (apart from the incorrectness/absence of aliases) so, if fixing
the SQL doesn't cure the problem, look at the sizes of those output fields
in the individual sets. If the sizes and types don't match, you'll need to
CAST() in the second set.

>Thanks for your suggestions so far. I have a new log to climb, then
>tumble, then climb, then tumble (I have many many reports where I will
>be updating this code...)
>:)

Don't worry so much, Ryan. These things usually hammer down to one silly
little thing....
:-)
Temp here right now is 39.8 deg C, clouding over, atmosphere getting
sticky, looking forward to sunset.

Helen