ALTER TABLE VENDA DROP CONSTRAINT CKC_IDORIGEMVENDA_VENDA
/

ALTER TABLE VENDA ADD CONSTRAINT CKC_IDORIGEMVENDA_VENDA CHECK (IDORIGEMVENDA IN
    (
        'BAL_FOS',
        'BAL_FNC',
        'BAL_SAT',
        'BAL_AUT',
        'BAL_BAN',
        'MES_FOS',
        'MES_FNC',
        'MES_SAT',
        'MES_MOB',
        'MES_PKR', 
        'CMD_FOS',
        'CMD_FNC',
        'CMD_SAT',
        'CMD_MOB',
        'CMD_PKC',
        'CMD_MIC',
        'DLV_FOS',
        'DLV_FNC',
        'DLV_SAT',
        'DLV_IFO',
        'DLV_PJA',
        'DLV_SIT',
        'DLV_CAL',
        'DLV_INT',
        'SPS',
        'FOS_MAN',
        'AJU_FOS',
        'VND_MAN',
        'VND_CAT',
        'INDEFIN',
        'DLV_SPO',
        'DLV_TAA',
        'DLV_APP',
        'DLV_ADR',
        'DLV_IOS',
        'TGO_APP',
        'TGO_TAA',
        'BGR_APP',
        'BGR_TAA',
        'DLV_ABF',
        'DLV_ONY',
        'DLV_WZP',
        'DLV_YAN',
        'DLV_UBR',
        'DLV_RAP',
        'BAL_MOB',
        'CMD_THR',
        'BAL_APP',
        'BAL_TAA',
        'MES_APP',
        'MES_TAA',
        'DLV_NWB',
        'DLV_NAD',
        'DLV_NOS',
        'DLV_NMO',
        'DLV_NBT',
        'CMD_OGO',
        'DLV_SID',
        'DLV_99F',
        'DLV_JAM',
        'DLV_4AL',
        'DLV_ORD',
        'TGO_4AL',
        'BGR_4AL',
        'THR_TAA',
        'DLV_DDI'
    )
)
/

ALTER TABLE COMANDAVEN DROP CONSTRAINT CKC_IDORGCMDVENDA_COMANDAVEN
/

ALTER TABLE COMANDAVEN ADD CONSTRAINT CKC_IDORGCMDVENDA_COMANDAVEN CHECK (IDORGCMDVENDA IN
    (
        'MES_PKR',
        'MES_FOS',
        'MES_MOB',
        'CMD_PKC',
        'CMD_FOS',
        'CMD_MOB',
        'CMD_MIC',
        'DLV_FOS',
        'DLV_FNC',
        'DLV_SAT',
        'DLV_IFO',
        'DLV_PJA',
        'DLV_SIT',
        'DLV_CAL',
        'DLV_INT',
        'MES_FNC',
        'CMD_FNC',
        'SPS',
        'MES_SAT',
        'CMD_SAT',
        'DLV_SPO',
        'DLV_TAA',
        'DLV_APP',
        'DLV_ADR',
        'DLV_IOS',
        'TGO_APP',
        'TGO_TAA',
        'BGR_APP',
        'BGR_TAA',
        'DLV_ABF',
        'DLV_ONY',
        'DLV_WZP',
        'DLV_YAN',
        'DLV_UBR',
        'DLV_RAP',
        'CMD_THR',
        'BAL_APP',
        'BAL_TAA',
        'MES_APP',
        'MES_TAA',
        'DLV_NWB',
        'DLV_NAD',
        'DLV_NOS',
        'DLV_NMO',
        'DLV_NBT',
        'DLV_SID',
        'DLV_99F',
        'DLV_JAM',
        'DLV_4AL',
        'DLV_ORD',
        'TGO_4AL',
        'BGR_4AL',
        'THR_TAA',
        'DLV_DDI'
    )
)
/