举个sqlserver的例子 select object_name(c.id) as 表名 ,c.name as 字段名 ,t.name 数据类型 ,c.length 长度 ,c.prec as 精度 ,p.value as 字段说明 ,m.text as 默认值 ,case when c.status=0x80 then 1 else 0 end 标识 ,c.iscomputed 是否已计算该列的标志 ,c.isnullable 是否允许空值 ,c.isoutparam 是否输出参数 from syscolumns c inner join systypes t on c.xusertype=t.xusertype left join sysproperties p on c.id=p.id and c.colid = p.smallid left join syscomments m on c.cdefault=m.id where objectproperty(c.id,'IsUserTable')=1 and object_name(c.id)='dat_deptinfo'
不好意思,你试下这个 select * from syscat.tables where tabschema='在这里请填写你的当前用户名'
select TABLE_NAME from all_tables where owner = 'SCOTT';
SQL> SELECT * FROM all_tables WHERE OWNER="scott"; SELECT * FROM all_tables WHERE OWNER="scott" * 第 1 行出现错误: ORA-00904: "scott": invalid identifier 会有这个错误哦?
SQL> SELECT * FROM all_tables WHERE OWNER="system"; SELECT * FROM all_tables WHERE OWNER="system" * 第 1 行出现错误: ORA-00904: "system": invalid identifier这个SYSTEM账户也一样的
,c.name as 字段名
,t.name 数据类型
,c.length 长度 ,c.prec as 精度
,p.value as 字段说明
,m.text as 默认值
,case when c.status=0x80 then 1 else 0 end 标识
,c.iscomputed 是否已计算该列的标志
,c.isnullable 是否允许空值
,c.isoutparam 是否输出参数
from syscolumns c
inner join systypes t on c.xusertype=t.xusertype
left join sysproperties p on c.id=p.id and c.colid = p.smallid
left join syscomments m on c.cdefault=m.id
where objectproperty(c.id,'IsUserTable')=1 and object_name(c.id)='dat_deptinfo'
select * from syscat.tables where tabschema='在这里请填写你的当前用户名'
SELECT * FROM all_tables WHERE OWNER="scott"
*
第 1 行出现错误:
ORA-00904: "scott": invalid identifier
会有这个错误哦?
SELECT * FROM all_tables WHERE OWNER="system"
*
第 1 行出现错误:
ORA-00904: "system": invalid identifier这个SYSTEM账户也一样的