: Creating update statements on the fly
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
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
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
3 matches
Mail list logo