Skip to main content
Inspiring
June 5, 2009
Question

cfqueryparam and systax error

  • June 5, 2009
  • 1 reply
  • 916 views

from this line of code, i got ann error "Conversion failed when converting the varchar value '103,102,101' to data type int. "    what should i do, pls help.

<cfset IDList = "#ValueList(getpeople.id)#">

<cfquery name="get_archive" datasource="#db#">

.......

or id not in (<cfqueryparam value="#IDList#" cfsqltype="cf_sql_varchar">)

</cfquery>

Thanks

This topic has been closed for replies.

1 reply

ilssac
Inspiring
June 5, 2009

The correct syntax for a list parameter:

<cfqueryparam value="#ValueList(getpeople.id)#" list="yes" cfsqltype="cf_sql_varchar">

kt03Author
Inspiring
June 5, 2009

wow, many thanks lan Skinner !!