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: data type question

Re: data type question

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: Tue, 27 Jul 1999 04:32:49 GMT
Message-ID: <37a13409.2037169@netnews.worldnet.att.net>


On Mon, 26 Jul 1999 15:36:22 -0400, "Finnegan Calabro" <fcalabro_at_aisvt.bfg.com> wrote:

>Can you specify a list of strings as the only possible values for a database
>(ie as opposed to simply integer or varchar, can there be only a small
>number of accepted values)? thanks very much

You would need to do this using a check constraint. For example:

create table X (

	list_column		varchar2(10),
	constraint valid_list_items
		check (list_column in ('A','B','C'))
	);

I believe the above syntax is correct, or at least very close to correct.

Hope this helps.

Jonathan



jonathan_at_gennick.com
http://gennick.com
Brighten the Corner Where You Are Received on Mon Jul 26 1999 - 23:32:49 CDT

Original text of this message

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