3

How can i set a column in oracle to not accept numbers above 10000 and below 0?

FenrisL
  • 287
  • 5
  • 17

1 Answers1

7

You are looking for a check constraint:

alter table t add constraint chk_t_col check (col >= 0 and col <= 10000);

This will prevent inserting or updating any values in the column that are not in the specified range.

Gordon Linoff
  • 1,242,037
  • 58
  • 646
  • 786