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

Dynamic Mesaage Building - SQL Dangling Apostrophe

New Here ,
Jan 14, 2009 Jan 14, 2009

Copy link to clipboard

Copied

Hi,

I have the following issue..and hoping that someone out there can be of assitance.
I have inherited a coldfusion app and bugs seem to be always close by..
The issue i am having is as follows:
1) A SQL query that inserts a row containg an email msg into a comms audit table and includes the whole html formatted email
2)The sql query however is defined as follows as attached
3) The error returns is a SQL one as is related to a dangling apostrophe in the <cfinclude> part of the query (The template creates an html formatted message based on various queries etc.)

My question is how do ensure that intergrity of the message and prevent this error?
I have already looked into using 'preservesinglequotes' and cfqueryparam - however with no luck..
TOPICS
Advanced techniques

Views

292

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

correct answers 1 Correct answer

LEGEND , Jan 15, 2009 Jan 15, 2009
before your query do:
<cfsavecontent variable="emailmessagebody"><cfinclude
template="#mancbPath#/mancb_body.cfm"></cfsavecontent>

then in your query instead of using '<cfinclude ...>' use
'#emailmessagebody#'

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

Votes

Translate

Translate
LEGEND ,
Jan 15, 2009 Jan 15, 2009

Copy link to clipboard

Copied

before your query do:
<cfsavecontent variable="emailmessagebody"><cfinclude
template="#mancbPath#/mancb_body.cfm"></cfsavecontent>

then in your query instead of using '<cfinclude ...>' use
'#emailmessagebody#'

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/

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
New Here ,
Jan 15, 2009 Jan 15, 2009

Copy link to clipboard

Copied

LATEST
Thanks, this seems to work quite well

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