如何显示现有表的 “CREATE TABLE”?

huangapple go评论45阅读模式
英文:

How to show "CREATE TABLE" for existing table?

问题

在MySQL中,有一个SQL语句可以显示已存在表的"CREATE TABLE"语句:

SHOW CREATE TABLE mytable;

Firebird 2.5中相应的SQL语句是什么?

英文:

In MySQL, there's SQL statement to show the "CREATE TABLE" statement for existed tables

SHOW CREATE TABLE `mytable`;

what is the equivalent of SQL statement for Firebird 2.5?

答案1

得分: 1

在Firebird本身中没有等效的语句。各种工具提供从数据库的元数据中反向工程CREATE TABLE语句的功能。

例如,在Firebird中包含的命令行查询工具ISQL中,您可以使用命令行选项-extract(或简写为-ex)生成整个数据库的DDL,但无法提取单个表。

isql -extract -user sysdba -password <您的密码> localhost:<数据库>

其他Firebird特定的工具也有类似的选项,通常支持提取单个对象。例如,在FlameRobin中,您可以右键单击数据库对象,选择“生成代码”,然后选择“提取<对象名称>的完整DDL”,或者双击或右键单击对象,在“属性”中查看DDL选项卡中的DDL。

英文:

There is no equivalent statement in Firebird itself. Various tools provide features to reverse engineer the CREATE TABLE statement from the metadata of the database.

For example, in ISQL (the commandline query tool included in Firebird), you can use commandline option -extract (or -ex for short) to generate the DDL of the entire database, but you can't extract a single table.

isql -extract -user sysdba -password &lt;your password&gt; localhost:&lt;database&gt;

Other Firebird-specific tools have similar options, and usually support extracting individual objects. For example, in FlameRobin, you can right click on a database object, Generate code, Extract full DDL for &lt;objectname>, or double click or right click, Properties on an object and view the DDL in the DDL tab of the properties.

huangapple
  • 本文由 发表于 2023年5月15日 13:11:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/76251021.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定