Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Seeking Equivalent of InterBase Domain
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')
*
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