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

problems with quotations marks

Guest
Aug 15, 2008 Aug 15, 2008

Copy link to clipboard

Copied

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?
TOPICS
Advanced techniques

Views

215

Translate

Translate

Report

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 ,
Aug 15, 2008 Aug 15, 2008

Copy link to clipboard

Copied

Use the PreserveSingleQuotes function.

Votes

Translate

Translate

Report

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
Community Expert ,
Aug 16, 2008 Aug 16, 2008

Copy link to clipboard

Copied

LATEST
I should also expect this to work:

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

Votes

Translate

Translate

Report

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
Documentation