CREATE TABLE ETIQUETAAF( 
   CDOPERADOR 		VARCHAR2(12) 	NOT NULL,
   NRETIQUETA 		NUMBER 			NOT NULL,
   NRAUTOFORN 		VARCHAR2(10) 	NOT NULL,
   NRORG 			NUMBER 			DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL,
   IDATIVO 			VARCHAR2(1) 	DEFAULT 'S' NOT NULL
	CONSTRAINT CKC_IDATIVO_ETIQUETAAF CHECK (IDATIVO IN ('S','N')),
   DTINCLUSAO 		DATE 			NULL,
   DTULTATU 		DATE 			NULL,
   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'
)
/

CREATE INDEX PLA01241_FK ON ETIQUETAAF (NRETIQUETA  ASC)
/   

ALTER TABLE ETIQUETAAF ADD 
	CONSTRAINT FKPLA01241FILIAL FOREIGN KEY (NRETIQUETA)
		REFERENCES ETIQUETAECOMMERCE (NRETIQUETA) ON DELETE CASCADE