Skip to main content
Participating Frequently
April 11, 2008
Question

Cold Fusion Error

  • April 11, 2008
  • 3 replies
  • 464 views
While processing a script I get the following error:
Error Executing Database Query. [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'forum=1 and zip IN ()'.
The error occurred on line 99.

I know the value in the database is not empty for the zip I am passing.

This topic has been closed for replies.

3 replies

Inspiring
April 20, 2008
Compute the zipcode list prior to the query, and cfdump it to make sure it is in the form "zip1,zip2,zip3, .." (comma separated numbers with no spaces and no embedded quotes). Then use the variable containing the list as the value of a cfqueryparam tag, to make sure it is properly interpreted by the database driver, e.g. if the well-formed list is in var zipList ..
BKBK
Community Expert
Community Expert
April 13, 2008
I expected the line to be like this:

ListQualify(Valuelist(square.zip), "'", ",", "all")

Inspiring
April 11, 2008
1) does your cfc actually return ZIP? cfdump the returnvariable to see.
2) urelated: why not use QuotedValueList() instead of
LIstQualify(ValueList())?

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/