0

I'm a beginner on oracle apex and im trying to implement a constraint that only allows variables in a column that start with a certain letter ('P') and are followed by numeric digits. Any help?

Mureinik
  • 297,002
  • 52
  • 306
  • 350

1 Answers1

1

You could use the regexp_like operator:

ALTER TABLE mytable
ADD CONSTRAINT mytable_field_check
CHECK (REGEXP_LIKE (myfiled, 'P[0-9]*'))
Mureinik
  • 297,002
  • 52
  • 306
  • 350