Adding Null to a column

  • Thread starter Patrick Olurotimi Ige
  • 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;
}
 
E

Elton Wang

Hi Patrick,

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

HTH

Elton Wang
(e-mail address removed)
 
T

Tampa.NET Koder

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top