Due to a weird request, I can’t put null in a database if there is no value. I’m wondering what can I put in the store procedure for nothing instead of null.
For example:
insert into blah (blah1) values (null)
Is there something like nothing or empty for ‘blah1’ instead using null?
I would push back on this bizarre request. That’s exactly what
NULLis for in SQL, to denote a missing or inapplicable value in a column.Is the requester experiencing grief over SQL logic with
NULL?edit: Okay, I’ve read your reply with the extra detail about this job assignment (btw, generally you should edit your original question instead of posting more information in an answer).
You’ll have to declare all columns as
NOT NULLand designate a special value in the domain of that column’s data type to signify ‘no value.’ The appropriate value to choose might be different on a case by case basis, i.e. zero may signify nothing in aperson_agecolumn, but it might have significance in anitems_in_stockcolumn.You should document the no-value value for each column. But I suppose they don’t believe in documentation either. 🙁