Informix相当于mysql的SHOW CREATE TABLE

发布于 2024-10-04 03:50:09 字数 223 浏览 17 评论 0原文

在informix中是否有相当于MySQL的SHOW CREATE TABLE?我想在 Server Studio 上的 SQL Manager 中运行它,并且还想获取有关表列及其类型的信息。这可能吗?我找到了 systables、syscolumns 和信息模式,但对 select * from... 的输出得到的结果并不幸运。

Is there any equivalent to MySQL's SHOW CREATE TABLE <tablename> in informix? I would like to run it in the SQL Manager on the Server Studio and would also like to obtain information about a tables columns and their types. Is this possible? I've found the systables, syscolumns and information schema, but wasn't lucky with the results I got with the output of select * from... .

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

太阳男子 2024-10-11 03:50:09

我不知道这样的SQL命令。从命令行,您可以使用 dbschema 实用程序:

C:\Informix>dbschema -t abc -d test
DBSCHEMA Schema Utility       INFORMIX-SQL Version 11.50.TC6DE

{ TABLE "informix".abc row size = 4 number of columns = 1 index size = 0 }
create table "informix".abc
  (
    xxx integer
  );

revoke all on "informix".abc from "public" as "informix";

如果您想读取系统表,请查看我的脚本,该脚本转储有关表、列、索引等的信息: activestate.com/recipes/576621-dump-informix-schema-to-text/?in=user-186902" rel="noreferrer">http://code.activestate.com/recipes/576621-dump-informix-schema -to-text/?in=user-186902 。在其源代码中,您将找到可以使用的 systables 查询。

I don't know such SQL command. From command line you can use dbschema utility:

C:\Informix>dbschema -t abc -d test
DBSCHEMA Schema Utility       INFORMIX-SQL Version 11.50.TC6DE

{ TABLE "informix".abc row size = 4 number of columns = 1 index size = 0 }
create table "informix".abc
  (
    xxx integer
  );

revoke all on "informix".abc from "public" as "informix";

If you want to read systables, then look at my script that dumps info about tables, columns, indexes etc: http://code.activestate.com/recipes/576621-dump-informix-schema-to-text/?in=user-186902 . In its source you will find systables queries you can use.

旧城空念 2024-10-11 03:50:09

您还可以从 DB-Access 或 ISQL 中获取基本列名称和类型,

INFO COLUMNS FOR <table>

我不知道这在 SQL Manager 中是否有效,但尝试不需要任何成本。

You can also obtain the basic column names and types from within DB-Access or ISQL with

INFO COLUMNS FOR <table>

I don't know whether this works in SQL Manager or not, but it costs nothing to try.

和我恋爱吧 2024-10-11 03:50:09

此 SQL 语句列出了列和类型,但不列出默认值等。

select
  t.tabname, c.*
from
  systables t
join
  syscolumns c
on
  t.tabid = c.tabid
where
  t.tabname = 'table'

This SQL statement lists columns and types, but not defaults, etc.

select
  t.tabname, c.*
from
  systables t
join
  syscolumns c
on
  t.tabid = c.tabid
where
  t.tabname = 'table'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文