When is an integer not an integer?
Mar. 21st, 2011 04:38 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
When you're doing a UNION in a ColdFusion Query of Queries, that's when. I've met some interesting idiosyncracies in there before, but this is a new one on me.
I'm doing a series of CFQUERIES on a MySQL DB that all return the same column names, then using cfquery dbtype="query" to UNION the lot.
The problem is that one table has a column defined as INT(11) signed, and the others are INT(10) unsigned. I can compare the two in MySQL, no problem. But when I try to do the UNION, I'm told that I can't compare a BIGINT with a normal INTEGER.
So, I tried to CAST the odd one out to match the others. Now I'm told I can't compare an INTEGER with... a Java object???
I'm casting all those integers as unsigned integer (which most of them were to start with). The UNION now works.
I'm doing a series of CFQUERIES on a MySQL DB that all return the same column names, then using cfquery dbtype="query" to UNION the lot.
The problem is that one table has a column defined as INT(11) signed, and the others are INT(10) unsigned. I can compare the two in MySQL, no problem. But when I try to do the UNION, I'm told that I can't compare a BIGINT with a normal INTEGER.
So, I tried to CAST the odd one out to match the others. Now I'm told I can't compare an INTEGER with... a Java object???
I'm casting all those integers as unsigned integer (which most of them were to start with). The UNION now works.