CREATE TABLE FCT_RECURSOSORCA 
(
    NRSEQRECURORCA     	        NUMBER        	        NOT NULL,    
    NRSEQORCAMENTO     	        NUMBER        	        NOT NULL,    
    NRVERSAOORCAMENTO  	        NUMBER        	        NOT NULL,    
    CDFILIAL           	        VARCHAR2(4)   	        NOT NULL,   
    NRITEMORCAMENTO    	        NUMBER        	        NULL,        
    CDPRODUTO                   VARCHAR2(10)  	        NULL,        
    CDBEMATIVO                  VARCHAR2(10)  	        NULL,        
    NRPESSOA           	        VARCHAR2(10)  	        NULL,        
    NRORG                       NUMBER 			DEFAULT 	 SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
    IDATIVO                     VARCHAR2(1)             DEFAULT 'S' NOT NULL,
      CONSTRAINT CKC_IDATIVO_FCT_RECURSOSORCA CHECK (IDATIVO IN ('S','N')),
    DTINCLUSAO         	        DATE                   	NULL,
    DTULTATU                    DATE                    NULL,
    NRORGINCLUSAO      	        NUMBER            	DEFAULT 1 NULL,
    CDOPERINCLUSAO              VARCHAR2(12)  		DEFAULT '1' NULL,
    NRORGULTATU                 NUMBER             	DEFAULT 1 NULL,
    CDOPERULTATU        	VARCHAR2(12)  		DEFAULT '1'
)
/
CREATE INDEX SM00196_FK ON FCT_RECURSOSORCA (NRSEQORCAMENTO ASC)
/
ALTER TABLE FCT_RECURSOSORCA
    ADD CONSTRAINT FKSM00196FCT_VENDEDORORCA FOREIGN KEY  (NRSEQORCAMENTO)
       REFERENCES FCT_ORCAMENTO (NRSEQORCAMENTO) ON DELETE CASCADE