问个问题,我想给字段添加默认值,默认值来自function,function是成功创建的
function的名字为GetTypeCode tableName为test123
列为typeCode
以下是我的DDL语句:
ALTER TABLE test123 ADD CONSTRAINT codeDefault DEFAULT GetTypeCode() FOR typeCode;
但是执行不通过
错误信息:[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT GetTypeCode() FOR typeCode' at line 1
有人知道什么原因吗?
function的名字为GetTypeCode tableName为test123
列为typeCode
以下是我的DDL语句:
ALTER TABLE test123 ADD CONSTRAINT codeDefault DEFAULT GetTypeCode() FOR typeCode;
但是执行不通过
错误信息:[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT GetTypeCode() FOR typeCode' at line 1
有人知道什么原因吗?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货