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



>I will paste the actual query directly.
>I must be missing something...

Yup. Corrections in lower case, as before:


>SELECT P.PTI_ID AS ID, // int
> CAST('p.PTI' AS VARCHAR(10)) AS CAT,
> P.BOXNUM AS BOXNUM, // domain, VarChar12
> P.REFNUM AS REFNUM, // domain, VarChar16
> P.PTIDATE AS JOBDATE, // DATE
> CP.NAME AS CLIENT,
> SP.NAME AS STATE
>FROM PTI P
> LEFT JOIN CLIENT CP ON (P.CL_ID = CP.CL_ID)
> LEFT JOIN STATES SP ON (P.ST_ID = SP.ST_ID)
>WHERE P.BOXNUM CONTAINING 'MMSF'
>UNION
>SELECT B.BD_ID AS ID, // int
> CAST('b.Breakdown' AS VARCHAR(10)) AS CAT,
> B.BOXNUM AS BOXNUM, // domain, VarChar12
> B.REFNUM AS REFNUM, // domain, VarChar16
> B.BDOWNDATE AS JOBDATE, // DATE
> CB.NAME AS CLIENT,
> SB.NAME AS STATE
>FROM BDOWN B
> LEFT JOIN CLIENT CB ON (B.CL_ID = CB.CL_ID)
> LEFT JOIN STATES SB ON (B.ST_ID = SB.ST_ID)
>WHERE B.BOXNUM CONTAINING 'MMSF'
>ORDER BY 1, 3
>
>I have checked all the fields, and they are all same datatype/size
>(most are domains) - indicated above after comment//
>
>I'm still getting the problem though...

Just occurred to me: Is this the actual message you are getting?

"column list & variable list do not match" (ex Subject)

This message occurs in the course of executing a SP, when there is a
mismatch between the column list in a [FOR] SELECT....INTO :<LIST OF
VARIABLES> and the list of variables that you are feeding them into. It
will happen if there is a data type mismatch between the field and the
variable or between the number of output fields vs the number of variables.

So is there still more you are not telling? Is this SELECT statement
controlled by a FOR loop ????

Helen