That's a feature. CF is automatically escaping any single quotes in your
data -- normally a good thing. Try the preserveSingleQuotes() function or
(better) try using cfqueryparam.

  _____  

From: Ben Densmore [mailto:[EMAIL PROTECTED]
Sent: Monday, 20 September 2004 3:32 p.m.
To: CF-Talk
Subject: Strange list behavior

I am running a query then taking the results of the query and storing
them in a list using the quotedValueList() function. I am then doing
another query to see if any of the values in the list match any values
in the database using the following:

SELECT Distinct subcategory_name
FROM subcategories
WHERE subcategory_code in (#codeList#)

If I output codeList it looks like :
'UPWW','UPCO','CART','SLUG','LTAG'  which is how the values should look.

However, when I run this, CF is throwing an "Incorrect Syntax error"
and the values are displaying like this in the error message:
SELECT Distinct subcategory_name
FROM subcategories
WHERE subcategory_code in (''UPWW'',''UPCO'',''CART'',''SLUG'',''LTAG'')

Why would CF be adding double quotes in the list? This is what is
causing the error, if I run the query in Query Ananlyzer with single
quotes it works fine.

Has anyone run into something like this before? Even if I take the
query and add single quotes around each value in the query itself and
just use valueList() it gives me the same error.

Thanks,
Ben
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to