[KCFusion]

2003-07-30 Thread Adaryl Wakefield



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.


RE: [KCFusion]

2003-07-30 Thread Matt Jones



cfqueryparam value="" cfsqltype="CF_SQL_VARCHAR" 
null="Yes"

  -Original Message-From: Adaryl Wakefield 
  [mailto:[EMAIL PROTECTED]Sent: Wednesday, July 30, 2003 10:40 
  AMTo: [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.


RE: [KCFusion]

2003-07-30 Thread Kory Bakken



If you do not use 
stored procedures, you could do this:


UPDATE blah
SET thisAttribute =cfif 
isdefined('var')#var#cfelseNULL/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 
  AMTo: [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.


Re: [KCFusion]

2003-07-30 Thread Adaryl Wakefield



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 - 
  From: 
  Kory Bakken 
  To: [EMAIL PROTECTED] 
  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#cfelseNULL/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 
AMTo: [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.