question

G

Guest

When i insert "" to db (integer type), it will become 0
how to insert null when the text is ""
 
E

Eliyahu Goldin

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
 
N

Nathan Sokalski

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.
 
C

Christopher Reed

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

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top