英文:
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 <your password> localhost:<database>
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 <objectname>, or double click or right click, Properties on an object and view the DDL in the DDL tab of the properties.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论