Topic
  • 2 replies
  • Latest Post - ‏2013-06-04T06:28:16Z by Sreeharsha_Naik
286T_john_samuel_saquing
2 Posts

Pinned topic how to create tables using db2 command line processor? what is a sample code for it?

‏2013-05-19T16:02:41Z |
  • J-kub
    J-kub
    6 Posts

    Re: how to create tables using db2 command line processor? what is a sample code for it?

    ‏2013-05-21T17:57:38Z  

    http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/r0000927.htm

    i.e.

    CREATE TABLE AWESOME (AWESOME_ID BIGINT NOT NULL, AWESOME_NAME VARCHAR(32) NOT NULL CONSTRAINT PK_AWESOME PRIMARY KEY (AWESOME_ID)) 

  • Sreeharsha_Naik
    Sreeharsha_Naik
    34 Posts

    Re: how to create tables using db2 command line processor? what is a sample code for it?

    ‏2013-06-04T06:28:16Z  

    Hi John,

    Follow these 3 simple steps on the admin CLP :

    1. Create a database first using : CREATE DB SAMPLE
    2. connect to your sample database using : CONNECT TO SAMPLE
    3. create your table using : CREATE TABLE TAB1 ( COL1 NOT NULL, COL2 NOT NULL )

    Thanks
    Harsha