janewilliams20: (geek)
janewilliams20 ([personal profile] janewilliams20) wrote2011-03-21 04:38 pm
Entry tags:

When is an integer not an integer?

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.


Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting