I do not understand why this SQL doesn’t work. I’m basically trying to assign a TEXT datatype a default value since it doesn’t support one.
DELIMITER /
CREATE TRIGGER ifEventDesciptionNull
BEFORE INSERT ON Event
FOR EACH ROW
BEGIN
IF NEW.description = NULL THEN
SET NEW.description = 'No description available.';
END/
DELIMITER ;
I get an error about syntax at line 7 (this doesn’t include the delimiter switcharoo) near ”. I am sure I wouldn’t need to ask for help if the error returned pointed something out. Similarly, it is invalid in Oracle, which creates it with compilation errors and does not allow anything to be added to the table.
Thank you in advance!
when comparing to
NULL, useIS NULLnot= NULL