Posts

Showing posts from October, 2011

Default value for TEXT type in MySQL

TEXT type in MySQL cannot have a default value.
We can use trigger to get a default value when a new record is inserted:

create trigger
my_trigger_name
before insert on lists for each row set NEW.customfield='';