CREATE TABLE ITEMRATEIOEFET (
  CDITEMRATEIOEFET VARCHAR2(5) NOT NULL, 
  NRITEMRATEIOEFET NUMBER(10) NOT NULL, 
  CDFILIAL VARCHAR2(4) NOT NULL, 
  NRORGULTATU NUMBER(10) DEFAULT 1 NULL, 
  NRORGINCLUSAO NUMBER(10) DEFAULT 1 NULL, 
  CDOPERINCLUSAO VARCHAR2(12) DEFAULT '1' NULL, 
  NRORG NUMBER(10) DEFAULT SYS_CONTEXT('nrorg_ctx','nrorg') NOT NULL, 
  IDATIVO VARCHAR2(1) DEFAULT 'S' NOT NULL, 
  NMITEMRATEIOEFET VARCHAR2(50) NOT NULL, 
  DTINCLUSAO DATE DEFAULT NULL NULL, 
  DTULTATU DATE DEFAULT NULL NULL, 
  CDOPERULTATU VARCHAR2(12) DEFAULT '1' NULL,
  CONSTRAINT PK_ITEMRATEIOEFET PRIMARY KEY(NRITEMRATEIOEFET)
)
/
ALTER TABLE ITEMRATEIOEFET ADD CONSTRAINT CKC_IDATIVO_ITEMRATEIOEFET CHECK (IDATIVO IN ('S', 'N'))
/
ALTER TABLE ITEMRATEIOEFET ADD CONSTRAINT FKPLA00998FILIAL FOREIGN KEY (CDFILIAL) REFERENCES FILIAL (CDFILIAL)
/
CREATE INDEX FKPLA00998FILIAL ON ITEMRATEIOEFET (CDFILIAL)