I have a custom type defined as this :
CREATE TYPE myType_t AS VARRAY(2) of char(10);
Is it possible to add a check constraint on the char(10) type, so myType_t items respect a certain regex? I tried things like
CREATE TYPE myType_t AS VARRAY(2) of char(10)
( constraint c_myType_format check ( regexp_like(IdontKnowWhatToWriteHere, '[:digit:]{8}'));
which obviously doesn’t work… I thought maybe defining another type for the
AS VARRAY(2) of myOtherType_t
but here again I don’t know where to put the regex check.
And yes, I also tried adding the constraint to the table that will use my type, but I can’t find the correct syntax.
According to Oracle documentation: