Adding Null to a column

  • Thread starter Thread starter Patrick Olurotimi Ige
  • Start date Start date
P

Patrick Olurotimi Ige

I'm trying to add NULL to a column in the database but the sql below
isn't updating?

if (name=="")
{
strCmd += "UPDATE";
strCmd += " EMPLOYEEDETAILS SET ";
strCmd+= "name='"+null+"',designation='"+desg+"',sex='"+sex+"'
,age="+age+" , salary="+salary+" where id="+id;
}
 
Hi Patrick,

Use NULL without single quotation mark, e.g. SET name =
NULL .

HTH

Elton Wang
(e-mail address removed)
 
Patrick,

Please try not to double post. If you looked at the post you made earlier
today at 1:53am then you would have gotten the answer to your question.
 
Back
Top