alter table employees add constraint emp_sal_ck2 check (length(sal) =15 or length(sal) =18 )
查询数据库中,表结构的详细信息 SELECT
表名=case when acolorder=1 then dname else '' end,
字段序号=acolorder,
字段名=aname,
标识=case when COLUMNPROPERTY( aid,aname,'IsIdentity')=1 then '√'else '' end,
主键=case when exists(SELECT 1 FROM sysobjects where xtype='PK' and name in (
SELECT name FROM sysindexes WHERE indid in(
SELECT indid FROM sysindexkeys WHERE id = aid AND colid=acolid
))) then '√' else '' end,
类型=bname,
占用字节数=alength,
长度=COLUMNPROPERTY(aid,aname,'PRECISION'),
小数位数=isnull(COLUMNPROPERTY(aid,aname,'Scale'),0),
允许空=case when aisnullable=1 then '√'else '' end,
默认值=isnull(etext,''),
字段说明=isnull(g[value],'')
FROM syscolumns a
left join systypes b on axtype=bxusertype
inner join sysobjects d on aid=did and dxtype='U' and dname<>'dtproperties'
left join syscomments e on acdefault=eid
left join sysproperties g on aid=gid and acolid=gsmallid
order by aid,acolorder
以上就是关于oracle数据库添加约束长度为15或18位全部的内容,包括:oracle数据库添加约束长度为15或18位、oracle数据库有一个字段,长度超过表结构的长度或字段格式不对,导致查询的时候查询报错、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)