------------------------------------------------------
-- Tabela TABELADWCLI
------------------------------------------------------
create table tabeladwcli
(
CDTABELADWCLI   VARCHAR2(20)    NOT NULL,
NMTABELADWCLI   VARCHAR2(30)    NOT NULL,
CONSTRAINT PK_TABELADWCLI PRIMARY KEY(CDTABELADWCLI)
)
/


------------------------------------------------------
-- Tabela ITEMDWCLI
------------------------------------------------------
create table ITEMDWCLI
(
NRSEQITEMDWCLI      VARCHAR2(10)    NOT NULL,
CDAREANEGOCLI       VARCHAR2(2)     NULL,
NMAREANEGOCLI       VARCHAR2(30)    NULL,
CDTABELADWCLI          VARCHAR2(30)    NOT NULL,
CDITEMDWCLI         VARCHAR2(30)    NOT NULL,
NMITEMDWCLI         VARCHAR2(30)    NULL,
IDFATODWCLI         CHAR(1)         NOT NULL,
IDTPFATODWCLI       CHAR(1)         NOT NULL,
DSHINTITEMCLI       VARCHAR2(200)   NULL,
CDCLIENTE           VARCHAR2(21)    NOT NULL,
CONSTRAINT PK_ITEMDWCLI PRIMARY KEY (CDCLIENTE,NRSEQITEMDWCLI),
CONSTRAINT FKGSC00004TABELADWCLI FOREIGN KEY (CDTABELADWCLI) REFERENCES TABELADWCLI(CDTABELADWCLI),
CONSTRAINT FKGSC00031CLIENTE  FOREIGN KEY (CDCLIENTE)  REFERENCES CLIENTE(CDCLIENTE)
)
/



------------------------------------------------------
-- Tabela DIMENSAODWCLI
------------------------------------------------------
create table DIMENSAODWCLI
(
NRSEQUEDIMECLI    VARCHAR2(3)     NOT NULL,    
CDTABELADIMECLI   VARCHAR2(30)    NULL,
CDITEMDIMECLI     VARCHAR2(30)    NOT NULL,
NMITEMDIMECLI     VARCHAR2(30)    NOT NULL,
DSPKDIME2CLI      VARCHAR2(30)    NULL,
IDDIMENSAODWCLI   CHAR(1)         NOT NULL,
DSITEMDIMECLI     VARCHAR2(30)    NULL,
DSPKDIMECLI       VARCHAR2(30)    NULL,
CDTABELADWCLI        VARCHAR2(20)    NOT NULL,
CDCLIENTE         VARCHAR2(21)    NOT NULL,
CONSTRAINT PK_DIMENSAODWCLI PRIMARY KEY (CDCLIENTE,CDTABELADWCLI,NRSEQUEDIMECLI),
CONSTRAINT FKGSC00005TABELADWCLI FOREIGN KEY (CDTABELADWCLI) REFERENCES TABELADWCLI(CDTABELADWCLI),
CONSTRAINT FKGSC00032CLIENTE  FOREIGN KEY (CDCLIENTE)  REFERENCES CLIENTE(CDCLIENTE)
)
/