Set the correct empty value depending on the database field type (see #6424)