A Domain for Data

  • Comments posted to this topic are about the item A Domain for Data

  • The Oracle CREATE DOMAIN looks really interesting.

    If you are familiar with the dunder functions in Python it looks like the DISPLAY clause the equivalent of Python's __repr__.  For non-Python people, if you have an object with properties and you say print(my_object) the __repr__ function lets you define which properties will be displayed and how they will be formatted.

    The ORDER clause is also of interest.  If I understand it correctly it means that you can specify what an ORDER BY  would do if the domain was applied to a column.  The example given was of a domain for a postal address and the domain ORDER clause specified the concatenated US State and US ZIP code as the desired order.

    It seems somewhat like T-SQL's CREATE TYPE command

  • I've actually been implementing domains in T-SQL for decades. Not with a CREATE DOMAIN statement but using reference tables, table valued functions, and scalar functions.

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho

  • Domains in reference /lookup tables are a staple, or should be. It's one of the major hassles I see in NoSQ/document stores.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply