如何在dashDB控制台中获取表DDL?

时间:2016-06-15 06:45:13

标签: dashdb

我使用控制台加载功能从CSV文件在dashDB中创建了一个表。

如何仅使用dashDB控制台获取表DDL?

3 个答案:

答案 0 :(得分:0)

最后,我查看了表格定义并选择了html并将其粘贴到文本编辑器中。

dblook本来是一个更好的选择,但我无法通过ssl支持获得命令行工具设置。

答案 1 :(得分:0)

您可以从这里免费下载包含db2look等工具的运行时客户端:https://www-01.ibm.com/marketing/iwm/iwm/web/preLogin.do?source=swg-idsclt并对您的dashDB实例和数据库进行编目。

答案 2 :(得分:0)

对于dashDB Local,请尝试以下命令以显示用于创建表的SQL DDL语句(CREATE TABLE)。我从Docker CLI客户端尝试了这个,我可以从Kitematic窗口启动它。

docker exec -it dashDB db_ddl_table -db bludb

以下是我看到的输出的快照:

bash-3.2 $ docker exec -it dashDB db_ddl_table -db bludb

-- Timestamp: Fri Jun 24 20:46:39 UTC 2016
-- Database Name: bludb

-- DDL Statements for Table "IBMADT  "."AUDITTRAIL"

CREATE TABLE "IBMADT  "."AUDITTRAIL"  (
          "RECORDID" BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (
            START WITH +1
            INCREMENT BY +1
            MINVALUE +1
            MAXVALUE +9223372036854775807
            NO CYCLE
            CACHE 20
            NO ORDER ) ,
          "ACTIVITYTIME" TIMESTAMP NOT NULL WITH DEFAULT CURRENT TIMESTAMP ,
          "ACTIVITYTYPE" VARCHAR(30 OCTETS) NOT NULL ,
          "ACTIVITYPARAMS" VARCHAR(255 OCTETS) ,
          "USERID" VARCHAR(255 OCTETS) NOT NULL ,
          "USERROLE" VARCHAR(20 OCTETS) NOT NULL ,
          "REMOTEHOST" VARCHAR(255 OCTETS) ,
          "SESSIONID" VARCHAR(255 OCTETS) ,
          "RESPONSECODE" CHAR(5 OCTETS) )
         IN "USERSPACE1"
         ORGANIZE BY ROW@

-- DDL Statements for Primary Key on Table "IBMADT  "."AUDITTRAIL"

ALTER TABLE "IBMADT  "."AUDITTRAIL"
    ADD PRIMARY KEY
        ("RECORDID")@

-- DDL Statements for Table "DB2GSE  "."GSE_COORDINATE_SYSTEMS"

CREATE TABLE "DB2GSE  "."GSE_COORDINATE_SYSTEMS"  (
          "COORDSYS_NAME" VARCHAR(128 OCTETS) NOT NULL ,
          "DEFINITION" VARCHAR(2048 OCTETS) NOT NULL ,
          "ORGANIZATION" VARCHAR(128 OCTETS) ,
          "ORGANIZATION_COORDSYS_ID" INTEGER ,
          "DESCRIPTION" VARCHAR(256 OCTETS) ,
          "DEFINER" VARCHAR(128 OCTETS) NOT NULL WITH DEFAULT USER )
         IN "USERSPACE1"
         ORGANIZE BY ROW@