Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Seeking Equivalent of InterBase Domain
In past InterBase databases that I have worked with, since there is no
Boolean data type, I have used a Domain called BOOLEAN_DOMAIN, defined
in DDL as follows:
create domain BOOLEAN_DOMAIN as CHAR(1) default 'N' NOT NULL check ((VALUE = 'N') or (VALUE = 'Y'));
then in my create table statements it becomes very simple:
create table MY_TABLE (
TABLE_KEY KEY_DOMAIN NOT NULL,
HAS_BOOL BOOLEAN_DOMAIN,
etc.
So far the only thing I have seen to do in Oracle is to create the boolean column as Char(1) and then put a check constraint below my primary key constraint definition.
I have explored using a "Type", but it seems that this construct goes way beyond what a domain is designed for in InterBase. There is also some reference in the literature to sub-types. Are sub-types related?
Any suggestions?
Monte Received on Fri Jan 19 2007 - 13:41:24 CST
![]() |
![]() |