Distinct User-defined Types
Sometimes called just distinct types, these were introduced an optional feature (S011) to allow existing atomic types to be given a distinct meaning, allowing the type checking mechanism to detect some logical errors, e.g. accidentally adding an age to a salary. For example:
CREATE TYPE age AS INTEGER FINAL; CREATE TYPE salary AS INTEGER FINAL;create two different and incompatible types. The SQL distinct types use name equivalence not structural equivalence like typedefs in C. It's still possible to perform compatible operations on (columns or data) of distinct types by using an explicit type CAST
.
Few SQL systems support these. IBM DB2 is one those supporting them. Oracle database does not currently support them, recommending instead to emulate them by a one-place structured type.
Read more about this topic: SQL:1999, New Features, Data Types
Famous quotes containing the words distinct and/or types:
“I have ever deemed it fundamental for the United States never to take active part in the quarrels of Europe. Their political interests are entirely distinct from ours. Their mutual jealousies, their balance of power, their complicated alliances, their forms and principles of government, are all foreign to us. They are nations of eternal war.”
—Thomas Jefferson (17431826)
“Science is intimately integrated with the whole social structure and cultural tradition. They mutually support one otheronly in certain types of society can science flourish, and conversely without a continuous and healthy development and application of science such a society cannot function properly.”
—Talcott Parsons (19021979)