ALTER TABLE ITDETALORCAMESGOP ADD CONSTRAINT CKC_IDENTRSAIDOP_ITDETALORCMES CHECK (IDENTRSAIDOP IS NULL OR (IDENTRSAIDOP IN ('E', 'S')))
/
ALTER TABLE ITDETALORCAMESGOP ADD CONSTRAINT CKC_IDATIVO_ITDETALORCAMESGOP CHECK (IDATIVO IN ('S', 'N'))
/
ALTER TABLE ITDETALORCAMESGOP ADD CONSTRAINT PK_ITDETALORCAMESGOP PRIMARY KEY (NRITDETALORCAMESGOP)
/
ALTER TABLE ITDETALORCAMESGOP ADD CONSTRAINT FKGOP00691ITORCAMESGOP FOREIGN KEY (NRITORCAMESGOP) REFERENCES ITORCAMESGOP (NRITORCAMESGOP) ON DELETE CASCADE
/
ALTER TABLE ITDETALORCAMESGOP ADD CONSTRAINT FKGOP00692PRODUTO FOREIGN KEY (CDPRODUTO) REFERENCES PRODUTO (CDPRODUTO)
/
ALTER TABLE ITDETALORCAMESGOP ADD CONSTRAINT FKGOP00693TIPOOPERAC FOREIGN KEY (CDTIPOOPER, IDENTRSAIDOP) REFERENCES TIPOOPERAC (CDTIPOOPER, IDENTRSAIDOP)
/
ALTER TABLE ITDETALORCAMESGOP ADD CONSTRAINT FKGOP00694DESPORCAMO FOREIGN KEY (CDORCAMENTOMO, CDFILIALMO, CDDESPADMFAT) REFERENCES DESPORCAMO (CDORCAMENTOMO, CDFILIAL, CDDESPADMFAT)
/
CREATE INDEX FKGOP00691ITORCAMESGOP ON ITDETALORCAMESGOP (NRITORCAMESGOP)
/
CREATE INDEX FKGOP00692PRODUTO ON ITDETALORCAMESGOP (CDPRODUTO)
/
CREATE INDEX FKGOP00693TIPOOPERAC ON ITDETALORCAMESGOP (CDTIPOOPER, IDENTRSAIDOP)
/
CREATE INDEX FKGOP00694DESPORCAMO ON ITDETALORCAMESGOP (CDORCAMENTOMO, CDDESPADMFAT)