Skip to main content
Known Participant
September 22, 2011
Question

null in cfqueryparam

  • September 22, 2011
  • 1 reply
  • 895 views

in sql stamement i have where name is null, how do i put it in the cfqueryparam

where name = <cfqueryparam type="cf_sql_char" value ="" is NUll />?

thanks

This topic has been closed for replies.

1 reply

Inspiring
September 22, 2011

Do you mean you wish to find records where the name is NULL? If so, you do not need to use cfqueryparam. Just use the keywords IS NULL:

        WHERE Name IS NULL

newcfAuthor
Known Participant
September 22, 2011

thanks,

so if i am passing specify value not the variables from the form then i don't need the cfqueryparam right?

example,

in sql statement i have: where work='p' then i don't think i need to put in in the cfqueryparam like

<Cfqueryparam type="sql_char" value ="p">?

thanks again

Owainnorth
Inspiring
September 22, 2011

That is correct. CFQueryparam is for variables, so if it's not going to change it doesn't need one.