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 -> QUESTION: can you create a new datatype and setting/getting there values

QUESTION: can you create a new datatype and setting/getting there values

From: barry <bbulsara23_at_hotmail.com>
Date: 9 Oct 2003 12:58:37 -0700
Message-ID: <747f1dec.0310091158.792d62f9@posting.google.com>


Hi, in Oracle you can go

create table testtable(a number,b number);

insert into testtable values(1,0);
insert into testtable values(33,1);
insert into testtable values(1,16);

select * from testtable where a=1;

Question



Can I create my own datatype in Oracle, called for example BNO, and insert into and select from this new datatype using a similar syntax so that the syntax to use BNO is the same type of syntax to use for number, varchar2, etc.

Like

create table testtable(a number, b BNO); insert into testtable values (1,0);

Here BNO is a 'number', but I want my object to have a default 'constructor' or 'setter' that accepts a number, and if none exists then get an error. To select from the table, I want a default 'getter' ... etc

If you can do this type of thing can someone please post some keywords to search on and I will try to find the information from there? Thank you
Barry Received on Thu Oct 09 2003 - 14:58:37 CDT

Original text of this message

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