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

ValueList error

New Here ,
Jul 29, 2009 Jul 29, 2009

Copy link to clipboard

Copied

Hi all,


I am getting an error with this code:

<cfquery name="session.Job_JpActiveResultList" dbtype="query">
SELECT *
from session.job_Sorted
where AnnounceNum IN (#ValueList(qJpPostID.fk_Job_AnnounceNum)#)
</cfquery>

The error states that
"the select column reference [TU_1] is not a column in any of the tables of the FROM table list"

Hard-coded, the query looks like this:
<cfquery name="session.Job_JpActiveResultList" dbtype="query">
SELECT * from session.job_Sorted where AnnounceNum IN (0001,0002,0003,0004,0005,0006,0007,TU_1,0011,0008)
</cfquery>

This same code runs in a different place in my site with no problem, but it's not run as a QofQ in that case.

The field type of "AnnounceNum" and "fk_Job_AnnounceNum" is "varchar".

I've tried single quotes around different portions of e "valuelist" code, but it doesn't help. I get this error:


Invalid CFML construct found on line 23 at column 66.
ColdFusion was looking at the following text:

\'

This is critical to my site. The AnnounceNum is unique and must be varchar.

Any help is appreciated.

TOPICS
Advanced techniques

Views

720

Translate

Translate

Report

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

correct answers 1 Correct answer

Valorous Hero , Jul 29, 2009 Jul 29, 2009

If the values are varchar's, they must obviously be quoted. Take a look at the QuotedValueList function, or try <cfqueryparam list="true" ...> (without the quotes).

Votes

Translate

Translate
Valorous Hero ,
Jul 29, 2009 Jul 29, 2009

Copy link to clipboard

Copied

LATEST

If the values are varchar's, they must obviously be quoted. Take a look at the QuotedValueList function, or try <cfqueryparam list="true" ...> (without the quotes).

Votes

Translate

Translate

Report

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
Documentation