Yeah I actually tried
<cfset var = NULL>
first with no quotes cause I figured it would read it as the string NULL but it choked on that too.
I was trying to make things as elegant as possible. My next attempt was to just write an if with two separate SQL statements like
<cfif var is "">
    run this statement
<cfelse>
    run this statement
</cfif>
but i had no clue you could embed ifs in query tags. Which is better from a speed standpoint? Choose a statement or embed the if?
A.
----- Original Message -----
Sent: Wednesday, July 30, 2003 10:49 AM
Subject: RE: [KCFusion]

If you do not use stored procedures, you could do this:
 
UPDATE blah
SET thisAttribute = <cfif isdefined('var')>#var#<cfelse>NULL</cfif>
WHERE someStuff = someOtherStuff
 
The problem you had is that it reads:
<cfset var = ""> as and empty string
and
<cfset var = "NULL"> as the actual string "NULL"
-----Original Message-----
From: Adaryl Wakefield [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 30, 2003 10:40 AM
To: [EMAIL PROTECTED]
Subject: [KCFusion]

I have need to update a table and set a value to NULL like
 
UPDATE blah
SET thisAttribute = nullValueHere
WHERE someStuff = someOtherStuff
 
so far I've tried
<cfset var = "">
and
<cfset var = "NULL">
 
and some other things but so far nothing. Anybody know right off the bat where I'm going wrong?
A.

Reply via email to