Re: Domain for numbers.

From: JOG <jog_at_cs.nott.ac.uk>
Date: Thu, 17 Jan 2008 18:22:37 -0800 (PST)
Message-ID: <e0a54cac-7d5b-4681-a0f7-459235585794_at_d21g2000prf.googlegroups.com>


On Jan 17, 5:23 pm, "Evan Keel" <evank..._at_sbcglobal.net> wrote:
> "Naga lenoj" <nagale..._at_gmail.com> wrote in message
>
> news:35863c3b-d110-4605-831a-cff21b6ee1f6_at_d21g2000prf.googlegroups.com...
>
> > Actually, i have a need to store the numbers like "AS2303",
> > TS3381"(first 2 alphabets,next 3 numbers). What i want is, i have to
> > assign the integrity which can check the following values,
> > 23334, ASDER, SDE23, 233A4 and like this.
> > If i assign as a character type domain.Then i can't check the above
> > cases.
> > Can anyone help me?
> > I am using postgresql(for your information).
>
> Check constraints are light-weight when it comes to defining domains. You
> need to enforce this rule (not a domain) via a trigger or a stored proc.
> And still you can join a price with a weight, which destroys the whole idea
> of a domain.

Does it indeed! Being british I know that the £2.00 in my pocket was once of equivalent worth to exactly 2lb of silver - hence the currency name. I'm thinking I might even be able to defend a natural join from those attributes :)

But yes, I do wonder why even in Oracle one cannot define new domains via some sort of set builder notation. Oracle does offer "object user types", but these only have very limited constructor mechanisms (where one might define the domain), and each instance is identified by an OID to boot. Yuk.

>
> Evan
Received on Fri Jan 18 2008 - 03:22:37 CET

Original text of this message