Skip to content

Commit 49e984f

Browse files
authored
Create 1-creating-domain.sql
1 parent d7f5424 commit 49e984f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
REM Script for 23c: 1-creating-domain.sql
2+
3+
-- optional drop the domain.
4+
-- Using FORCE in contrast to PRESERVE disassociates the domain from all its dependent columns
5+
drop domain myemail_domain;
6+
7+
--create a domain to describe an email
8+
9+
create domain if not exists myemail_domain AS VARCHAR2(100)
10+
default on null 'XXXX' || '@missingmail.com'
11+
constraint email_c CHECK (regexp_like (myemail_domain, '^(\S+)\@(\S+)\.(\S+)$'))
12+
display substr(myemail_domain, instr(myemail_domain, '@') + 1);

0 commit comments

Comments
 (0)