CREATE TABLE ETL_SAPGRTPPRAT
(
    CDSUPERVISOR    VARCHAR2(12)           NULL    ,
    CDGOPERAC       VARCHAR2(12)           NULL    ,
    CDEMPRESA       VARCHAR2(2)            NULL    ,
    CDFILIAL        VARCHAR2(4)            NULL    ,
    CDAREAGERE      VARCHAR2(3)            NULL    ,
    CDSEGMER        VARCHAR2(5)            NULL    ,
    CDFILISERVFILI  VARCHAR2(9)            NULL    ,
    CDGRTIPOPR      VARCHAR2(2)            NULL    ,      
    CDTPFATSGTPRA   VARCHAR2(30)           NULL    ,
    ANETLSGTPRA     VARCHAR2(4)            NULL    ,
    MEETLSGTPRA     VARCHAR2(7)            NULL    ,
    BIETLSGTPRA     VARCHAR2(6)            NULL    ,
    TRETLSGTPRA     VARCHAR2(6)            NULL    ,
    SEETLSGTPRA     VARCHAR2(6)            NULL    ,
    VRCUSUNITPPRAT  FLOAT                  NULL    ,
    DTULTATUSGTPRA  DATE                   DEFAULT SYSDATE
)
/

CREATE INDEX IDX_SAPGRTPPRAT01 ON ETL_SAPGRTPPRAT (CDSUPERVISOR ASC)
/

ALTER TABLE ETL_SAPGRTPPRAT
    ADD CONSTRAINT FK_SAPGRTPPRAT01OPERADOR FOREIGN KEY  (CDSUPERVISOR)
       REFERENCES OPERADOR (CDOPERADOR)
/

CREATE INDEX IDX_SAPGRTPPRAT02 ON ETL_SAPGRTPPRAT (CDGOPERAC ASC)
/

ALTER TABLE ETL_SAPGRTPPRAT
    ADD CONSTRAINT FK_SAPGRTPPRAT02OPERADOR FOREIGN KEY  (CDGOPERAC)
       REFERENCES OPERADOR (CDOPERADOR)
/

CREATE INDEX IDX_SAPGRTPPRAT03 ON ETL_SAPGRTPPRAT (CDEMPRESA ASC)
/

ALTER TABLE ETL_SAPGRTPPRAT
    ADD CONSTRAINT FK_SAPGRTPPRAT01EMPRESA FOREIGN KEY  (CDEMPRESA)
       REFERENCES EMPRESA (CDEMPRESA)
/

CREATE INDEX IDX_SAPGRTPPRAT04 ON ETL_SAPGRTPPRAT (CDFILIAL ASC)
/

ALTER TABLE ETL_SAPGRTPPRAT
    ADD CONSTRAINT FK_SAPGRTPPRAT01FILIAL FOREIGN KEY  (CDFILIAL)
       REFERENCES FILIAL (CDFILIAL)
/

CREATE INDEX IDX_SAPGRTPPRAT05 ON ETL_SAPGRTPPRAT (CDAREAGERE ASC)
/

ALTER TABLE ETL_SAPGRTPPRAT
    ADD CONSTRAINT FK_SAPGRTPPRAT01AREAGERE FOREIGN KEY  (CDAREAGERE)
       REFERENCES AREAGERE (CDAREAGERE)
/

CREATE INDEX IDX_SAPGRTPPRAT06 ON ETL_SAPGRTPPRAT (CDSEGMER ASC)
/

ALTER TABLE ETL_SAPGRTPPRAT
    ADD CONSTRAINT FK_SAPGRTPPRAT01SEGMERCADO FOREIGN KEY  (CDSEGMER)
       REFERENCES SEGMERCADO (CDSEGMER)
/

CREATE INDEX IDX_SAPGRTPPRAT07 ON ETL_SAPGRTPPRAT (CDFILISERVFILI ASC)
/

CREATE INDEX IDX_SAPGRTPPRAT08 ON ETL_SAPGRTPPRAT (CDGRTIPOPR ASC)
/

ALTER TABLE ETL_SAPGRTPPRAT
    ADD CONSTRAINT FK_SAPGRTPPRAT01GRTIPOPR FOREIGN KEY  (CDGRTIPOPR)
       REFERENCES GRTIPOPR (CDGRTIPOPR)
/


-- VERSAO --
BEGIN ATUVEROBJ('ETL_SAPGRTPPRAT','5.01.003'); END;
/
