Skip to main content
October 18, 2012
Answered

cfqueryparam from clause

  • October 18, 2012
  • 2 replies
  • 902 views

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 ?

    This topic has been closed for replies.
    Correct answer Adam Cameron.

    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

    2 replies

    Adam Cameron.Correct answer
    Inspiring
    October 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

    Carl Von Stetten
    Legend
    October 18, 2012

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