Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: data type question
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