Solved

Using 'IN' operator in ColdFusion Query of Queries throwing error

Posted on 2009-07-15
4
595 Views
Last Modified: 2013-12-24
Hi,
I have the following query which is throwing an error:

<cfquery dbtype="query" name="getAtt">
select *, upper(lname) as ulname, upper(fname) as ufname from getAttendees
where breakout_id = '#trim(url.ids)#'
and id_register_status IN (1,3)
and id_rate_type NOT IN (1,2)   (this is the line that's breaking it.. causing error)
order by date_signup
</cfquery>

The datatype for id_rate_type is VCHARAR2 - Oracle DB.

Here's the error message:

Query Of Queries runtime error.  
Comparison exception while executing IN.
Unsupported Type Comparison Exception: The IN operator does not support comparison between the following types:
Left hand side expression type = "STRING".
Right hand side expression type = "LONG".


Any help resolving this will be greatly greatly appreciated.
Thank you  ~ Wendi
0
Comment
Question by:wkolasa
  • 2
  • 2
4 Comments
 
LVL 36

Accepted Solution

by:
SidFishes earned 500 total points
ID: 24862292
as the error says, you can't compare a string and an int

but this should work

and id_rate_type NOT IN ('1','2')

0
 

Author Comment

by:wkolasa
ID: 24862474
Thank you Fishes...  I tried  NOT IN ("1","2")   didn't work... tried  NOT IN ('1','2') and it did work.  What's the difference?   ((by the way, thank you for your answer.  and thank you for pointing out the obviousness too (funny))
0
 
LVL 36

Expert Comment

by:SidFishes
ID: 24862715
afaik QoQ's need '

it may be they were copying t-sql which uses ' (not sure about oracle)
maybe it looks at (" as the start of a list
maybe CF  just doesn't -like- "

not really sure
0
 

Author Closing Comment

by:wkolasa
ID: 31603843
thank!  youre aces!
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
htaccess restrict subdomain 4 131
How to stress test an ASP.NET https website 3 80
change time in cron 4 87
web & database SERVERS -- PHYSICAL & VM ? 5 72
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question