There's always the ASP way...
<!--- build the query --->
<cfset sql="update tablename set ">
<cfif condition1...>
<cfset sql=#sql# & " columname=value">
</cfif>
<cfif condition2...>
<cfset sql=#sql# & " where columname = 1">
</cfif>
<cfquery name="myquery" datasource="#dsn#">
#sql#
</cfquery>
Good Fortune,
Richard Walters,
Webmaster, Davita Laboratory Services
[EMAIL PROTECTED]
(800) 604-5227 x 3525
>>> [EMAIL PROTECTED] 03/29/02 11:10AM >>>
HI,
I wanted to create a Update statement on the fly. For creating a
Select
statement on the fly I have used
Select * from tablename
Where 0=0
<cfif isDefined(attributes.String1)>
and String1 = attributes.String1
</cfif>
How can I achieve this for update statement as I couldn't figure
out
where to put Set statement and the last line with out coma(',') in my
statement.
Thanks in advance.
Sudheer Chakka.
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists