Hello there,
I plan to create a new set of tables in a DB2 database. These have to be copies of ORACLE-tables (some 40-80 columns wide) With ORACLE I can produce "create table" scripts. How can I re-use these to run scripts on DB2 to create the same table-structures in DB2.
This is an typical example:
*********************************************************
CREATE TABLE STOCK_MOVEMENT (
SIT_SITE_ID VARCHAR2 (4) NOT NULL,
MRA_TYPE VARCHAR2 (4) NOT NULL,
MOV_ID VARCHAR2 (10) NOT NULL,
MOV_LINE NUMBER (10) NOT NULL,
MOV_LINE_ITEM NUMBER (10) NOT NULL,
MOV_LINE_SPLIT NUMBER (10) NOT NULL,
MOV_CLASS VARCHAR2 (2),
MOV_PRO_CODE VARCHAR2 (25),
MOV_QTY_REQUESTED NUMBER (10),
MOV_QTY_MOVED NUMBER (10),
MOV_UOM_CODE VARCHAR2 (3),
MOV_BOX_QTY NUMBER (10),
MOV_FROM_STAGE VARCHAR2 (2),
MOV_FROM_WHS_ID VARCHAR2 (3),
MOV_FROM_ZON_ID VARCHAR2 (3),
MOV_FROM_LOC_ID VARCHAR2 (15),
MOV_FROM_STT_ID VARCHAR2 (3),
MOV_FROM_STU VARCHAR2 (20),
MOV_FROM_OWN_ID VARCHAR2 (10),
MOV_FROM_STATUS VARCHAR2 (2),
MOV_FROM_ALLOC_TYP VARCHAR2 (3),
MOV_FROM_ALLOC_REF VARCHAR2 (15),
MOV_FROM_OLO VARCHAR2 (10),
MOV_FROM_STK_ID VARCHAR2 (10),
MOV_TO_STAGE VARCHAR2 (2),
MOV_TO_WHS_ID VARCHAR2 (3),
MOV_TO_ZON_ID VARCHAR2 (3),
MOV_TO_LOC_ID VARCHAR2 (15),
MOV_TO_STT_ID VARCHAR2 (3),
MOV_TO_STU VARCHAR2 (20),
MOV_TO_OWN_ID VARCHAR2 (10),
MOV_TO_STATUS VARCHAR2 (2),
MOV_TO_ALLOC_TYP VARCHAR2 (3),
MOV_TO_ALLOC_REF VARCHAR2 (15),
MOV_TO_OLO VARCHAR2 (10),
MOV_TO_STK_ID VARCHAR2 (10),
MOV_VIA_STT_ID VARCHAR2 (3),
MOV_VIA_STU VARCHAR2 (20),
MOV_VIA_STK_ID VARCHAR2 (10),
MOV_OPE_ID VARCHAR2 (10),
MOV_SUPERVISOR VARCHAR2 (10),
MOV_REASON_CODE VARCHAR2 (3),
MOV_DATE_CREATED DATE,
MOV_TIME_CREATED DATE,
MOV_DATE_PICKED DATE,
MOV_TIME_PICKED DATE,
MOV_DATE_HELD DATE,
MOV_TIME_HELD DATE,
MOV_DATE_ACTIONED DATE,
MOV_TIME_ACTIONED DATE,
MOV_STAGE VARCHAR2 (2),
MOV_REF_1 VARCHAR2 (9),
MOV_REF_2 VARCHAR2 (9),
PRIMARY KEY ( SIT_SITE_ID, MRA_TYPE, MOV_ID, MOV_LINE, MOV_LINE_ITEM, MOV_LINE_SPLIT ) ) ;
******************************************************
Can I re-use it when I modify the datatypes?
I plan to create a new set of tables in a DB2 database. These have to be copies of ORACLE-tables (some 40-80 columns wide) With ORACLE I can produce "create table" scripts. How can I re-use these to run scripts on DB2 to create the same table-structures in DB2.
This is an typical example:
*********************************************************
CREATE TABLE STOCK_MOVEMENT (
SIT_SITE_ID VARCHAR2 (4) NOT NULL,
MRA_TYPE VARCHAR2 (4) NOT NULL,
MOV_ID VARCHAR2 (10) NOT NULL,
MOV_LINE NUMBER (10) NOT NULL,
MOV_LINE_ITEM NUMBER (10) NOT NULL,
MOV_LINE_SPLIT NUMBER (10) NOT NULL,
MOV_CLASS VARCHAR2 (2),
MOV_PRO_CODE VARCHAR2 (25),
MOV_QTY_REQUESTED NUMBER (10),
MOV_QTY_MOVED NUMBER (10),
MOV_UOM_CODE VARCHAR2 (3),
MOV_BOX_QTY NUMBER (10),
MOV_FROM_STAGE VARCHAR2 (2),
MOV_FROM_WHS_ID VARCHAR2 (3),
MOV_FROM_ZON_ID VARCHAR2 (3),
MOV_FROM_LOC_ID VARCHAR2 (15),
MOV_FROM_STT_ID VARCHAR2 (3),
MOV_FROM_STU VARCHAR2 (20),
MOV_FROM_OWN_ID VARCHAR2 (10),
MOV_FROM_STATUS VARCHAR2 (2),
MOV_FROM_ALLOC_TYP VARCHAR2 (3),
MOV_FROM_ALLOC_REF VARCHAR2 (15),
MOV_FROM_OLO VARCHAR2 (10),
MOV_FROM_STK_ID VARCHAR2 (10),
MOV_TO_STAGE VARCHAR2 (2),
MOV_TO_WHS_ID VARCHAR2 (3),
MOV_TO_ZON_ID VARCHAR2 (3),
MOV_TO_LOC_ID VARCHAR2 (15),
MOV_TO_STT_ID VARCHAR2 (3),
MOV_TO_STU VARCHAR2 (20),
MOV_TO_OWN_ID VARCHAR2 (10),
MOV_TO_STATUS VARCHAR2 (2),
MOV_TO_ALLOC_TYP VARCHAR2 (3),
MOV_TO_ALLOC_REF VARCHAR2 (15),
MOV_TO_OLO VARCHAR2 (10),
MOV_TO_STK_ID VARCHAR2 (10),
MOV_VIA_STT_ID VARCHAR2 (3),
MOV_VIA_STU VARCHAR2 (20),
MOV_VIA_STK_ID VARCHAR2 (10),
MOV_OPE_ID VARCHAR2 (10),
MOV_SUPERVISOR VARCHAR2 (10),
MOV_REASON_CODE VARCHAR2 (3),
MOV_DATE_CREATED DATE,
MOV_TIME_CREATED DATE,
MOV_DATE_PICKED DATE,
MOV_TIME_PICKED DATE,
MOV_DATE_HELD DATE,
MOV_TIME_HELD DATE,
MOV_DATE_ACTIONED DATE,
MOV_TIME_ACTIONED DATE,
MOV_STAGE VARCHAR2 (2),
MOV_REF_1 VARCHAR2 (9),
MOV_REF_2 VARCHAR2 (9),
PRIMARY KEY ( SIT_SITE_ID, MRA_TYPE, MOV_ID, MOV_LINE, MOV_LINE_ITEM, MOV_LINE_SPLIT ) ) ;
******************************************************
Can I re-use it when I modify the datatypes?