ALTER TABLE PREVPAXSERVPRODM ADD CONSTRAINT FKCOC00750PREVPAXPRODM FOREIGN KEY (CDFILIAL, NRPREVISAOPROD, NRORG) REFERENCES PREVPAXPRODM (CDFILIAL, NRPREVISAOPROD, NRORG)
/
ALTER TABLE PREVPAXSERVPRODM ADD CONSTRAINT FKCOC00751PREVPAXCIAPRODM FOREIGN KEY (CDFILIAL, NRPREVISAOPROD, CDCIA, NRORG) REFERENCES PREVPAXCIAPRODM (CDFILIAL, NRPREVISAOPROD, CDCIA, NRORG)
/
ALTER TABLE PREVPAXSERVPRODM ADD CONSTRAINT FKCOC00752PREVPAXVOOPRODM FOREIGN KEY (CDFILIAL, NRPREVISAOPROD, CDCIA, NRVOO, CDTRECHO, NRORG) REFERENCES PREVPAXVOOPRODM (CDFILIAL, NRPREVISAOPROD, CDCIA, NRVOO, CDTRECHO, NRORG)
/
ALTER TABLE PREVPAXSERVPRODM ADD CONSTRAINT FKCOC00753PREVPAXCLAPRODM FOREIGN KEY (CDFILIAL, NRPREVISAOPROD, CDCIA, NRVOO, CDTRECHO, CDCLASSE, NRORG) REFERENCES PREVPAXCLAPRODM (CDFILIAL, NRPREVISAOPROD, CDCIA, NRVOO, CDTRECHO, CDCLASSE, NRORG)
/
ALTER TABLE PREVPAXSERVPRODM ADD CONSTRAINT FKCOC00754SERVICOCIAFILI FOREIGN KEY (CDFILIAL, CDCIA, NRSERVICOCIAFILI, NRORG) REFERENCES SERVICOCIAFILI (CDFILIAL, CDCIA, NRSERVICOCIAFILI, NRORG)
/
ALTER TABLE PREVPAXSERVPRODM ADD CONSTRAINT FKCOC00755SERVCICLO FOREIGN KEY (CDFILIAL, CDCIA, NRSERVICOCIAFILI, CDCLASSE, CDCICLO, NRORG) REFERENCES SERVCICLO (CDFILIAL, CDCIA, NRSERVICOCIAFILI, CDCLASSE, CDCICLO, NRORG)
/
CREATE UNIQUE INDEX UN_PREVPAXSERVPRODM ON PREVPAXSERVPRODM (CDFILIAL, NRPREVISAOPROD, CDCIA, NRVOO, CDTRECHO, CDCLASSE, NRSERVICOCIAFILI, CDCICLO, NRORG)
/
ALTER TABLE PREVPAXSERVPRODM ADD CONSTRAINT PK_PREVPAXSERVPRODM PRIMARY KEY (CDFILIAL, NRPREVISAOPROD, NRORG)
/
ALTER TABLE PREVPAXSERVPRODM ADD CONSTRAINT CKC_IDATIVO_PREVPAXSERVPRODM CHECK (IDATIVO IN ('S','N'))