Paul Wills
asked on
PreparedStatement update does not update on NULL values
Hi Experts
I am trying to update a field with NULL values without success, but If I put an empty String the update works. The problem with putting an empty string is - my column field "fruitname" accepts unique values. I am using JDBC. see below what I am trying to do.
update fruits_tbl set uxservernames=concat(fruit name, \r\n'" + fruitname + "') where fruit_id=" +fruit_id)
The columns
fruit_id (INT) PRK | fruitname (VARCHAR(255) | fruitdescr VARCHAR(255)|
The fruitname column can hold a NULL value.
Thank you.
I am trying to update a field with NULL values without success, but If I put an empty String the update works. The problem with putting an empty string is - my column field "fruitname" accepts unique values. I am using JDBC. see below what I am trying to do.
update fruits_tbl set uxservernames=concat(fruit
The columns
fruit_id (INT) PRK | fruitname (VARCHAR(255) | fruitdescr VARCHAR(255)|
The fruitname column can hold a NULL value.
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In my experience MySQL NULL does not match an empty string of zero length. However if the columns are defined NOT NULL DEFAULT '' an empty string will match.