The default value of the mysql table field is the return value of the function, which is implemented with mysql triggers

create trigger idtrigger
before insert on record_test_str
for each ROW
BEGIN
	SET new.ID=getIdFunc();
END


http://stackoverflow.com/questions/270309/can-i-use-a-function-for-a-default-value-in-mysql

Since the default value cannot be a function when mysql is creating a table, it is necessary to take a trigger device to implement.
However, it is not possible to insert and update the table monitored by the trigger in the mysql trigger.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326879701&siteId=291194637