post the code plz ;-)
Bryan Stevenson B.Comm.
VP Director of E-Commerce Development
Electric Edge Systems Group Inc.
phone: 250.480.0642
fax: 250.480.1264
cell: 250.920.8830
e-mail: [EMAIL PROTECTED]
web: www.electricedgesystems.com
[Todays Threads]
[This Message]
[Subscription]
[Fast
Stevenson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 17, 2004 2:44 PM
To: CF-Talk
Subject: Re: Inserting a query string into a text field
post the code plz ;-)
Bryan Stevenson B.Comm.
VP Director of E-Commerce Development
Electric Edge Systems Group Inc.
phone: 250.480.0642
fax: 250.480.1264
cell
So long as the query is enclosed in quotes and properly escaped, you
shouldn't have any problems.Something like:
CFSET sql = SELECT foo FROM bar WHERE baz = 'yadda'
CFQUERY NAME=InsertSQL DATASOURCE=#ds#
INSERT INTO foo
(
sqlCode
)
VALUES
(
'#Replace(sql, ', '', ALL)#'
)
PreserveSingleQuotes causes CF to NOT escape the single quotes in your text
string.Since the your text string has single quotes in it that need to be
inserted into the DB, then you need to let CF escape them or the query will
err out.
INSERT INTO tbl_CampaignMgrActionData (ActionString) VALUES
PreserveSingleQuotes causes CF to NOT escape the single quotes in your text
string.Since the your text string has single quotes in it that need to be
inserted into the DB, then you need to let CF escape them or the query will
err out.In other words, don't use PreserveSingleQuotes - let CF
shouldn't you be using an update instead of insert?
- Original Message -
From: Scott Stewart [EMAIL PROTECTED]
Date: Tue, 17 Aug 2004 15:49:19 -0400
Subject: RE: Inserting a query string into a text field
To: CF-Talk [EMAIL PROTECTED]
Here's the CF Code
cfquery name
cfquery name=qry_insertQueryString datasource=#application.dsn#
INSERT INTO tbl_CampaignMgrActionData
(ActionString)
VALUES
(cfqueryparam value=#monstor_query# cfsqltype=CF_SQL_VARCHAR)
WHERE tbl_CampaignMgrActionData.ActionID = #session.ActionID#
/cfquery
Doug
Scott Stewart wrote:
INSERT with a WHERE?? Did you mean to do an UPDATE?
- Original Message -
From: Doug James
To: CF-Talk
Sent: Tuesday, August 17, 2004 4:06 PM
Subject: Re: Inserting a query string into a text field
cfquery name=qry_insertQueryString datasource=#application.dsn#
INSERT
Hi Scott,
Off the top of my head, try using cfqueryparam to pass in your SQL code.
-joe
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
9 matches
Mail list logo