Skip to main content
August 15, 2008
Question

problems with quotations marks

  • August 15, 2008
  • 2 replies
  • 244 views
Hi,
I got some problems with quotations marks in my queries.

I am trying to do something like this:
<cfset Variables.sqlAux = "select * from customer where name='Rodrigo' ">

<cfquery>
#Variables.sqlAux#
</cfquery>


Coldfusion returns this error messagem:
Incorrect syntax near 'Rodrigo'.

Some one can help?
This topic has been closed for replies.

2 replies

BKBK
Community Expert
Community Expert
August 16, 2008
I should also expect this to work:

<cfquery>
#toString(Variables.sqlAux)#
</cfquery>

Inspiring
August 15, 2008
Use the PreserveSingleQuotes function.