1

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

FenrisL
  • 267
  • 5
  • 17

1 Answers1

6

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,198,228
  • 53
  • 572
  • 709