Skip to main content
Participating Frequently
July 2, 2008
Answered

cfqueryparam not working

  • July 2, 2008
  • 3 replies
  • 422 views

Update statement as follows

update data
set words= '#form.words#',
description= '#form.description#',
title= '#form.title#'
where page = '#form.id#'

is translated right by coldfusion to give the insert....

update data
set words= 'x',
description= 'y',
title= 'test'
where page = '3719'

Change the statement to use cfqueryparam as follows

update data
set words= '#form.words#',
description= '#form.description#',
title= <cfqueryparam value="#form.title#" cfsqltype="CF_SQL_VARCHAR" null="Yes">
where page = '#form.id#'

But the same form data produces an error.

update data
set words= 'x',
description= 'y',
title= ?
where page = '3719'

Query Parameter Value(s) -
Parameter #1(CF_SQL_VARCHAR) =


Any ideas? Coldfusion v7. MS SQL Server 2005
    This topic has been closed for replies.
    Correct answer Daverms
    Hi,

    What happens when you remove the null="yes" attribute?.

    3 replies

    Inspiring
    July 2, 2008
    Interestingly the documentation says,

    Yes --> Tag ignores the value attribute.

    ;-)
    AmpliconAuthor
    Participating Frequently
    July 2, 2008
    Then it works, even if the data is null.

    What's the point of the null part if it don't work?

    Thanks for the tip though.
    DavermsCorrect answer
    Inspiring
    July 2, 2008
    Hi,

    What happens when you remove the null="yes" attribute?.