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

Dynamic Mesaage Building - SQL Dangling Apostrophe

New Here ,
Jan 14, 2009 Jan 14, 2009
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
314
Translate
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/
Translate
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/
Translate
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
LATEST
Thanks, this seems to work quite well
Translate
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