CREATE TABLE NCSERVASS(
    NRSERVASS         VARCHAR2(10),      
    CDNCSERVASS       VARCHAR2(5),      
    NMSERVASS         VARCHAR2(50),     
    DTVINGINI         DATE,             
    DTVINGFIM         DATE,             
    URLARQTERMO       VARCHAR2(200),    
    NRFILASSOC     	  VARCHAR2(10),     
    VRNCSERVASS    	  FLOAT(126),  
	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_NCSERVASS CHECK (IDATIVO IN ('S','N'))
)
/

CREATE TABLE NCFILASSOC(
    NRFILASSOC        VARCHAR2(10),
    CDFILIAL          VARCHAR2(4),
	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_NCFILASSOC CHECK (IDATIVO IN ('S','N'))
)
/

CREATE TABLE NCPARAMFIN(
    NRPARAMFIN        VARCHAR2(10), 
    CDFILIAL          VARCHAR2(4),  
    DSFORMPG          VARCHAR2(20), 
    CDCONTREC      	  VARCHAR2(6),  
    CDCONTCOR      	  VARCHAR2(3),  
    CDTPOPER          VARCHAR2(2),   
	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_NCPARAMFIN CHECK (IDATIVO IN ('S','N'))
)
/
