derby数据库也存在数据字典表,中文的网上资料很少,放这里备忘。

列出数据库所有表:

select columnnumber, tablenane, columnname, columndatatype
    from sys.systables t, sys.syscolumns, sys.sysschemas s
    where tableid=referenceid and t.schemaid=s.schemaid

列出所有列:

 select s.schemaname || '.' || t.tablename 
     from sys.systables t, sys.sysschemas s 
     where t.schemaid = s.schemaid
          and t.tabletype = 'T'
     order by s.schemaname, t.tablename
 
列出所有表和对应的列名:
SELECT
t.tablename as stablename,c.columnname as scolumnname
FROM sys.systables t , sys.syscolumns c, sys.sysschemas s
where t.schemaid=s.schemaid
AND t.tableid = c.referenceid
and t.tabletype = 'T'

相关文章:

  • 2021-11-22
  • 2021-09-10
  • 2022-12-23
  • 2021-10-05
  • 2021-05-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-08
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
  • 2021-12-04
相关资源
相似解决方案