How to disable a constraint in ORACLE?

0

I have a table where two specific fields together can not have the same values.

BELIEVE what they are:

  • NUM_DIVISION
  • COD_INDICATOR

Assuming I have this data:

NUM_PERIODO_LANCAMENTO = 1 , COD_INDICADOR = 1 , COD_CR_PERIODO = 1

NUM_PERIODO_LANCAMENTO = 2 , COD_INDICADOR = 1 , COD_CR_PERIODO = 1

NUM_PERIODO_LANCAMENTO = 3 , COD_INDICADOR = 1 , COD_CR_PERIODO = 1

When I try to register this data

NUM_PERIODO_LANCAMENTO = 1 , COD_INDICADOR = 1 , COD_CR_PERIODO = 2

the constraint error is displayed.

I would like to release this registration, how to do this?

    
asked by anonymous 02.06.2014 / 17:05

1 answer

5

You can disable constraint checking with a ALTER TABLE :

ALTER TABLE tabela
DISABLE CONSTRAINT nome_da_constraint;

But be aware that this can lead to duplicate problems in your table if you do not fix the constraint.

    
02.06.2014 / 17:15