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

cfqueryparam from clause

Guest
Oct 18, 2012 Oct 18, 2012

Trying,

select ... from <cfqueryparam value="#leftside#" cfsqltype="CF_SQL_CHAR" maxlength="19">...

I am getting an error that I must declare table variable @p14. Leftside is initialized in ColdFusion.

Tried declare @p14 var(19) as the first line in the cfquery, right before the query itself, but got error saying @p14 was already declared.

How do you make this work ?

889
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

correct answers 1 Correct answer

LEGEND , Oct 18, 2012 Oct 18, 2012

You need to understand the difference between the SQL and the parameters being passed to the SQL.

Reading this might help: http://adamcameroncoldfusion.blogspot.co.uk/2012/07/what-one-can-and-cannot-do-with.html

--

Adam

Translate
Guide ,
Oct 18, 2012 Oct 18, 2012

I believe that you can only use CFQueryParam in the WHERE clause of queries.

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 ,
Oct 18, 2012 Oct 18, 2012
LATEST

You need to understand the difference between the SQL and the parameters being passed to the SQL.

Reading this might help: http://adamcameroncoldfusion.blogspot.co.uk/2012/07/what-one-can-and-cannot-do-with.html

--

Adam

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