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: Tue, 23 Jan 2007 08:49:15 +0000
Message-ID: <Gcdn4amLwctFFwHl@jimsmith.demon.co.uk>


In message <1169531413.53689_at_bubbleator.drizzle.com>, DA Morgan <damorgan_at_psoug.org> writes
>hasta_l3_at_hotmail.com wrote:
>
>> you have to repeat the type constraints for every column
>> defined with that type. It's a development nigthmare...
>> Monte, FWIW we are using SQL*Plus DEFINE ...
>> --- Raoul
>
>Possibly but not necessarily. Types have type bodies that
>contain methods. What is it that you would want to do, or
>the OP wants to do, that could not be defined in a type
>body.
>
>I'm not going to say that a method is or is not going to
>do the job. But I'd sure like to see a substantive example
>of what is being asked to see if it is or is not the case
>before just agreeing that a domain can do something that
>can not be done in Oracle.

To use your own exanp
SQL> CREATE OR REPLACE TYPE first_name AS OBJECT (

   2 first_name VARCHAR2(25));
   3 /

Type created.

SQL> create table names (

   2 fname first_name);

Table created.

SQL> insert into names(fname) values ('adsfads'); insert into names(fname) values ('adsfads')

                                  *

ERROR at line 1:
ORA-00932: inconsistent datatypes: expected JIM.FIRST_NAME got CHAR

The domain as described by the OP defines types which can be used like native types.

-- 
Jim Smith
Ponder Stibbons Limited <http://oracleandting.blogspot.com/>
RSS <http://oracleandting.blogspot.com/atom.xml>
Received on Tue Jan 23 2007 - 02:49:15 CST

Original text of this message

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