Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I insert/update records with some of the columns having NULL value?

columns insert null records value
0
Posted

How do I insert/update records with some of the columns having NULL value?

0

Location: http://www.jguru.com/faq/view.jsp?EID=545700 Created: Nov 12, 2001 Author: Harikrishna Neerkaje (http://www.jguru.com/guru/viewbio.jsp?EID=69829) Question originally posed by Tuan Truong (http://www.jguru.com/guru/viewbio.jsp?EID=32991 Use either of the following PreparedStatement methods: public void setNull(int parameterIndex, int sqlType) throws SQLException public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException Joe Sam Shirah adds: Note that these methods assume that the columns are nullable. In this case, you can also just omit the columns in an INSERT statement; they will be automatically assigned null values.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123