Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Seeking Equivalent of InterBase Domain

Re: Seeking Equivalent of InterBase Domain

From: Jim Smith <usenet01_at_ponder-stibbons.com>
Date: Mon, 22 Jan 2007 21:04:10 +0000
Message-ID: <a$ne$yiKbStFFwHy@jimsmith.demon.co.uk>


In message <1169495352.913842_at_bubbleator.drizzle.com>, DA Morgan <damorgan_at_psoug.org> writes
>Jim Smith wrote:
>> In message <1169489558.935801_at_bubbleator.drizzle.com>, DA Morgan
>><damorgan_at_psoug.org> writes
>>> Jim Smith wrote:
>>>> In message <1169405574.80550_at_bubbleator.drizzle.com>, DA Morgan
>>>><damorgan_at_psoug.org> writes
>>>>> Martijn Tonies wrote:
>>>>>
>>>>>> Can you assign a "check constraint" to a type?
>>>>>
>>>>> CREATE TABLE department_mgrs (
>>>>> dept_no NUMBER PRIMARY KEY,
>>>>> dept_name CHAR(20),
>>>>> dept_mgr person_typ,
>>>>> dept_loc location_typ,
>>>>> CONSTRAINT dept_loc_cons1
>>>>> UNIQUE (dept_loc.building_no, dept_loc.city),
>>>>> CONSTRAINT dept_loc_cons2
>>>>> CHECK (dept_loc.city IS NOT NULL) );
>>>>>
>>>> So that would be "No".
>>>
>>> You have a different interpretation of:
>>>
>>> CHECK (dept_loc.city IS NOT NULL) );
>>>
>>> Than I do.
>> As discussed earlier in the thread, the requirement is to create a
>>type and add a constraint to the type. Not apply the constraint to a
>>column which uses the type.
>> e.g.
>> create type positive_integer number(10,0) contraint pos_con (check
>>positive_integer > 0);
>> create table x
>> ( ...
>> age positive_integer,
>> ...
>> );
>> This can't be done in oracle.
>
>Use the CREATE TYPE BODY to define or implement the member methods
>defined in the object type specification. You create object types with
>the CREATE TYPE and the CREATE TYPE BODY statements. The CREATE TYPE
>statement specifies the name of the object type, its attributes,
>methods, and other properties. The CREATE TYPE BODY statement contains
>the code for the methods that implement the type.
>
>Source:
>http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/stat
>ements_8002.htm#SQLRF01502
>
>What is it you can not do in Oracle?

Try reading the thread instead of wandering off into your own little world.

-- 
Jim Smith
Ponder Stibbons Limited <http://oracleandting.blogspot.com/>
RSS <http://oracleandting.blogspot.com/atom.xml>
Received on Mon Jan 22 2007 - 15:04:10 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US