Subject | Re: Domains... Re: [firebird-support] Re: Insert succesfull while violating primary key constraint |
---|---|
Author | Tim Ledgerwood |
Post date | 2003-06-19T12:40:05Z |
>Yes, it's true there's a "conceptual" element in the thing. But the mainJa, I have recently started using domains (I've never really seen the need
>use of domains is to package a set of data attributes (type, size,
>constraints) into a re-usable bundle. It doesn't matter if (as in the
>simple example above) you define more than one domain with the same set of
>attributes. If their contextual use is different, it might be
>justified. You can add more constraints to a domain, as long as they won't
>be violated by any data already using the domain.
for them before - *embarrassed grin* - and am finding them exceptionally
useful for this very thing.
For example, every one of my tables has a field called "recordno", which is
an integer field that also forms the primary key.
So I just define a domain RECORDNUM INTEGER NOT NULL and bingo - I enforce
the same rules wherever I use it. There are other examples as well.
[Non-text portions of this message have been removed]