Skip to Main Content

Oracle Database Free

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DOMAIN syntax problems

Mike KutzApr 19 2023 — edited Apr 19 2023
-- works
drop domain if exists email_dom;

-- works
create domain if not exists email_dom as varchar2(100)
constraint email_chk check (regexp_like (email_dom, '^(\S+)\@(\S+)\.(\S+)$'));

-- EDIT: this actually works 
select domain_check('email_dom', 'grape@fruit.com') good,
       domain_check('email_dom', 'grape') bad,
       domain_check('email_dom', cast('grape@fruit.com' as email_dom) ) ugly;

Actual Questions

  • ~where is my typo?~
    • ignore this. i found my “missing right parenthesis”
  • How would I ad hoc domain_check a multi column domain?

Rhetorical questions showing areas of improvement for **domain**

  • why do I need to cast a value when the domain name is already given?
  • why is the domain name not a required parameter for domain_order and domain_display?
This post has been answered by Chris Saxon-Oracle on Apr 20 2023
Jump to Answer
Comments
Post Details
Added on Apr 19 2023
3 comments
565 views