为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:8
【操作系统】:ubuntu20.04
【CPU】:
【问题描述】*:
使用DESC查询表结构信息报错,我看手册里支持DESC啊,是哪里写的不对吗?或者达梦数据库有平替语句吗?
查表结构,desc只支持disql命令行。
程序查看可以用专用的函数或者视图
函数:
select convert(varchar, tabledef(user, 'T1'));
视图:
select name column_name,
(case
when (scale = 0 and (regexp_like(type$, 'INT|REAL|BIT|\<DATE\>|TIME|FLOAT|DOUBLE') or length$=2147483647)) then type$
when (scale <> 0 and regexp_like(type$,'NUM|DEC')) then type$ || '('|| length$ ||',' || scale || ')'
when (scale <> 0 and regexp_like(type$,'TIME')) then type$ || '(' || scale || ')'
else type$ || '(' || length$ || ')'
end
)column_type,
defval default_value,
decode(nullable$, 'N', 'NOT NULL') is_null
from syscolumns
where id = (
select id
from sysobjects
where subtype$='UTAB'
and schid = current_schid
and name = 'T1' )
这个命令是在disql工具里面才生效的:

参考《DM8_DIsql使用手册.pdf》