ALTER TABLE COMPCARDPESQ ADD CONSTRAINT CKC_IDEXIBEPRATO_COMPCARDPESQ CHECK (IDEXIBEPRATOPESQ IN ('S','N'))
/
ALTER TABLE COMPCARDPESQ ADD CONSTRAINT CKC_IDATIVO_COMPCARDPESQ CHECK (IDATIVO IN ('S','N'))
/
ALTER TABLE COMPCARDPESQ ADD CONSTRAINT PK_COMPCARDPESQ PRIMARY KEY(NRCOMPCARDPESQ, NRORG)
/
ALTER TABLE COMPCARDPESQ ADD CONSTRAINT FKMYM00648CARDADIA FOREIGN KEY (CDFILIAL, NRCARDAPIO, NRORG) REFERENCES CARDADIA (CDFILIAL, NRCARDAPIO, NRORG) ON DELETE CASCADE
/
CREATE INDEX MYM00648_FK ON COMPCARDPESQ (CDFILIAL, NRCARDAPIO, NRORG)
/
ALTER TABLE COMPCARDPESQ ADD CONSTRAINT FKMYM00649PRATO FOREIGN KEY (CDFILAUXPRAT, CDPRATO, NRORG) REFERENCES PRATO (CDFILAUXPRAT, CDPRATO, NRORG)
/
CREATE INDEX MYM00649_FK ON COMPCARDPESQ (CDFILAUXPRAT, CDPRATO, NRORG)
/
ALTER TABLE COMPCARDPESQ ADD CONSTRAINT FKMYM00650TIPOPRAT FOREIGN KEY (CDTIPOPRAT, NRORG) REFERENCES TIPOPRAT (CDTIPOPRAT, NRORG)
/
CREATE INDEX MYM00650_FK ON COMPCARDPESQ (CDTIPOPRAT, NRORG)
/
ALTER TABLE COMPCARDPESQ ADD CONSTRAINT FKMYM00651GRUPOPRATOPESQ FOREIGN KEY (NRGRUPOPRATOPESQ, NRORG) REFERENCES GRUPOPRATOPESQ (NRGRUPOPRATOPESQ, NRORG)
/
CREATE INDEX MYM00651_FK ON COMPCARDPESQ (NRGRUPOPRATOPESQ, NRORG)