File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
data-platform/core-converged-db/database-23c/23c-basic-examples Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ REM Script in 23c: domain .sql
2
+
3
+ drop domain yearbirth;
4
+
5
+ create domain yearbirth as number (4 )
6
+ constraint check ((trunc(yearbirth) = yearbirth) and (yearbirth >= 1900 ))
7
+ display (case when yearbirth < 2000 then ' 19-' ELSE ' 20-' end)|| mod(yearbirth, 100 )
8
+ order (yearbirth - 1900 )
9
+ annotations (title ' yearformat' );
10
+
11
+ drop table person;
12
+ create table person
13
+ ( id number (5 ),
14
+ name varchar2 (50 ),
15
+ salary number ,
16
+ person_birth number (4 ) DOMAIN yearbirth
17
+ )
18
+ annotations (display ' person_table' );
19
+
20
+ desc person
21
+
22
+ insert into person values (1 ,' MARTIN' ,3000 , 1988 );
23
+
24
+ select DOMAIN_DISPLAY(person_birth) from person;
25
+
26
+ -- monitor domains
27
+ set linesize window
28
+ col object_name format a20
29
+ col object_type format a15
30
+ col column_name format a15
31
+ col annotation_value format a25
32
+ col annotation_name format a20
33
+ col domain_owner format a10
34
+ col domain_name format a15
35
+
36
+ select * from user_annotations_usage;
37
+
38
+ col owner format a10
39
+ col name format a15
40
+
41
+ select * from user_domains;
You can’t perform that action at this time.
0 commit comments