I have a field with an id value.
a ) The value of this field cannot be values like 0, 00000000, 99999999. How do I express this in oracle? Will I do it with Regex?
b ) The field cannot be all letters and cannot contain characters such as periods or commas. I did the option a as follows but is it true?
select x_ID from table1 where regexp_like(x_ID,'[a-zA-Z]')
edit : It is not desired to consist of the same number value, for example 77777777. It cannot be shorter than 3 characters in length, for example 0, 12, 11. However, it can have a value like 12345678. AbCdEf or ABCDEF is wrong. Because it is not wanted to consist only of letters. It would be true if it was AbCdEf1 or ABCDEF1 because it also contains a numerical value. I will state all of these conditions as a separate condition in the query. 1- not null 2- The length of the x_ID field cannot be less than 3. and two more conditions I wrote above.
You can use the regular expression
^(.)\1*$
to detect strings that consist solely of one-or-more repetitions of a single character:If you want to add conditions to a column then you can add constraints for each one. Some examples could be: