Oracle Database 26ai will be available on generic Linux platforms in January and soon on AIX and Windows
Purpose
SQL Domains are objects that can be used to define constraints, display, ordering and annotations independent of a specific object and that,
much like a Class definition in an object oriented language, allow common attributes to be inherited by the columns (relational or JSON) of one or more tables.
I have opened multiple bugs on this new object type but what I expect to come back as a response is that "it all of it works but most of it does not work in SQL*Plus."
Note
Note: The sample code below is copied from the Oracle online documentation and blogs as this page is based on the 23.2 Beta version and not the GA release.
These examples will be replaced by Library generated examples after we have had a chance to work with that release. Thank you for your understanding and patience.
VALIDATE is the JSON equivalent of a relational Check Constraint.
CREATE DOMAIN [IF NOT EXISTS] [schema_name.] <domain_name> AS <data_type>
VALIDATE USING <json_schema_string>;
TBD
Basic with Constraint COLLATE clause
CREATE DOMAIN [IF NOT EXISTS] [schema_name.] <domain_name> AS <data_type>
COLLATE <collation_expression>;
CREATE DOMAIN uwphone_domain AS VARCHAR2(14)
COLLATE binary_ci;
ERROR at line 1:
ORA-43929: Collation cannot be specified if parameter MAX_STRING_SIZE=STANDARD is set.
MAX_STRING_SIZE was set to EXTENDED, a bug has been filed.
Basic with Constraint DISPLAY clause
CREATE DOMAIN [IF NOT EXISTS] [schema_name.] <domain_name> AS <data_type>
DISPLAY <data_display_expression>;
TBD: Examples copied from the docs do not appear to work.
Basic with Constraint ORDER clause
CREATE DOMAIN [IF NOT EXISTS] [schema_name.] <domain_name> AS <data_type>
ORDER <order_by_expression>;
TBD: Examples copied from the docs do not appear to work.