As a developer, i would like to use the power of SQL Domains for use by my PL/SQL data types so that I can write code that is resilient to GIGO.
The available data assertion:
subtype die_t as pls_integer range 1 .. 6 not null;
only works for pls_integer data types where as the following doesn't work for pls_integer data types at all
create domain die_dom as int not null check ( die_dom between 1 and 6 );
However, both assert the same data rules (a not null integer between 1 and 6)
SUGGESTED SYNTAX
Type based on an existing domain:
subtype die_t as domain die_dom;
Ad Hoc version:
subtype die_t as int not null check ( die_t between 1 and 6 );
For multi-column & flexible domains:
type rec_t is record ( ...., domain dom_name(..) );
type rec_f is record ( ...., domain dom_name(..) using (..) );