if ( select count(*) from newsletter where template_name = 'Basic') > 0
update newsletter set template = (param 1) where id =
**** there is no value here for ID in the where clause. ****
else
insert into newsletter ( template_name, template ) values ( 'Basic',
(param 2) )
-----Original Message-----
From: Protoculture [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 16, 2005 6:15 AM
To: CF-Talk
Subject: query help (ms sql)
heres the query. Seems to be chocking on the else statement... I've used
the cfqueryparam in the update before and its worked well enough. The
only thing I've noticed that looks odd is the cfdebugging output see
second section... I am trying to insert a long string of an html
template.
<SQL>
if (
select count(*) from newsletter
where template_name = '#form.template_name#') > 0
<!--- /* template already exists so do update */
--->
update newsletter
set template = <cfqueryparam
value="#form.EditorDefault#" cfsqltype="cf_sql_longvarchar">
where id = #form.templateId#
else
<!--- /* template does not exist so do insert */
--->
insert into newsletter ( template_name, template )
values (
'#form.template_name#',
<cfqueryparam value="#form.EditorDefault#"
cfsqltype="cf_sql_longvarchar">
)
<CFDEBUGGIN>
Notice the param 1 and param 2... I'm not sure what this is about.
if ( select count(*) from newsletter where template_name = 'Basic') > 0
update newsletter set template = (param 1) where id = else insert into
newsletter ( template_name, template ) values ( 'Basic', (param 2) )
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble
Ticket application
http://www.houseoffusion.com/banners/view.cfm?bannerid=48
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:198954
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54