CREATE TABLE RENTPRODOP(
    CDFILIAL	    VARCHAR2(4)       NOT NULL,
    CDLOJA	        VARCHAR2(10)      NOT NULL,
    VRROYALTIESPERC FLOAT(126)        NOT NULL,
    VRFPROPMARKPERC FLOAT(126)        NOT NULL,
    VRGASTOSLOJA    FLOAT(126)        NOT NULL,
    VRODPERC        FLOAT(126)        NOT NULL,
    VRQFR           NUMBER            NOT NULL, 
    VRQFP           NUMBER            NOT NULL, 
    VRM2            FLOAT(126)        NOT NULL,
    CDMES		    NUMBER            NOT NULL,
    CDANO	    	NUMBER            NOT NULL,
    NRORG             NUMBER 	      DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') 		NOT NULL,
    IDATIVO           VARCHAR2(1)     DEFAULT 'S'					NOT NULL,
    DTINCLUSAO        DATE            DEFAULT SYSDATE,
    DTULTATU          DATE            DEFAULT SYSDATE,
    NRORGINCLUSAO     NUMBER          DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')		NULL,
    CDOPERINCLUSAO    VARCHAR2(12)    DEFAULT '1' 					NULL,
    NRORGULTATU       NUMBER          DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg')		NULL,
    CDOPERULTATU      VARCHAR2(12)    DEFAULT '1',
	    CONSTRAINT CKC_IDATIVO_RENTPRODOP CHECK (IDATIVO IN ('S','N')),
        CONSTRAINT PK_RENTPRODOP PRIMARY KEY(CDFILIAL, CDLOJA, CDMES, CDANO)
)
/

CREATE INDEX RENTPRODOP_INDEX ON RENTPRODOP(CDMES ASC, CDANO  ASC, VRROYALTIESPERC  ASC, VRFPROPMARKPERC  ASC, VRGASTOSLOJA ASC, VRODPERC ASC, VRQFR ASC, VRQFP ASC, VRM2 ASC)
/