Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Cold Fusion Error

New Here ,
Apr 11, 2008 Apr 11, 2008
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.

TOPICS
Database access
431
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 11, 2008 Apr 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/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 13, 2008 Apr 13, 2008
I expected the line to be like this:

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 20, 2008 Apr 20, 2008
LATEST
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 ..
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources