question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When i insert "" to db (integer type), it will become 0
how to insert null when the text is ""
 
The best way of inserting nulls is just skipping the column in the insert
statement. Don't write to it and it will be null unless there is a default
value set for the column. BTW, it's always a good idea to specify what
database you are working with.

Eliyahu
 
My recommendation would be to simply do some String manipulation and replace
the "" with whatever keywords or control characters represent null in the
database you are using. This shouldn't be too hard, but you have not given
us enough information to do it for you.
 
In general, in an UPDATE statement, you can usually use SET field1 = NULL.
 

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

Back
Top