0

I have created a table in dashDB from a CSV file using the console load functionality.

How can I get the table DDL using only the dashDB console?

Chris Snow
  • 23,813
  • 35
  • 144
  • 309

3 Answers3

0

In the end, I viewed the table definition and selected the html and pasted it into a text editor.

dblook would have been a better option, but I couldn't get the command lines tools setup with ssl support.

Chris Snow
  • 23,813
  • 35
  • 144
  • 309
0

You can download the runtime client that includes the tools such as db2look from here for free: https://www-01.ibm.com/marketing/iwm/iwm/web/preLogin.do?source=swg-idsclt and catalog your dashDB instance and database.

  • Thanks Torsten. I did try the tools but couldn't get them to work over the ssl endpoint. – Chris Snow Jun 17 '16 at 06:45
  • Also, when are these tools going to be made available without having to manually login somewhere? Open source dbs make this so easy. – Chris Snow Jun 17 '16 at 06:53
0

For dashDB Local, try the below command to display the SQL DDL statement (CREATE TABLE) that was used to create a table. I tried this from the Docker CLI client that I was able to launch from the Kitematic window.

docker exec -it dashDB db_ddl_table -db bludb

Here is a snapshot of the output I am seeing:

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@
Kiran
  • 46
  • 1
  • Is the dashDB docker image available in docker's public repo? – Chris Snow Jun 25 '16 at 08:12
  • Yes, it's available on docker hub. You will need to register for the open preview in order to get it. Instructions are provided here https://hub.docker.com/r/dashdb/preview/ – Kiran Jun 25 '16 at 15:06