Question

Is there a way to write an insert/update query that checks if a column allows NULLs: If it does set the column to NULL, and '' (empty string) otherwise?

I would be something like:

UPDATE mytable 
SET field = IF(A_FUNCTION_TO_CHECK_IF_ALLOWS_NULL(), NULL, '');

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top