CREATE TABLE ARQXMLNSUNFE(
   NRINSJURIEST    VARCHAR2(20)  					 NOT NULL,
   NRORG 	       NUMBER 		  DEFAULT 	 		 SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
   IDATIVO         VARCHAR2(1)    DEFAULT 'S' 		 NOT NULL
      CONSTRAINT CKC_IDATIVO_ARQXMLNSUNFE 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',
   IDAMBIENTENFE   VARCHAR2(1)    					 NOT NULL
      CONSTRAINT CKC_ARQXMLNSUNFE_IDAMBIENTENFE CHECK (IDAMBIENTENFE IN ('1', '2')),
   NRNSU           VARCHAR2(15)   					 NOT NULL,
   DSARQXMLNSUNFE  CLOB           					 NOT NULL,
   CONSTRAINT PK_ARQXMLNSUNFE PRIMARY KEY (NRINSJURIEST, IDAMBIENTENFE, NRNSU)
)
/
ALTER TABLE ARQXMLNSUNFE
   ADD CONSTRAINT FKFIS0072NSUNFE FOREIGN KEY (NRINSJURIEST, IDAMBIENTENFE, NRNSU)
      REFERENCES NSUNFE (NRINSJURIEST, IDAMBIENTENFE, NRNSU) ON DELETE CASCADE