Tuesday 15 June 2010

sql - How can I create a table that only allows data to insert if they are allowed -



sql - How can I create a table that only allows data to insert if they are allowed -

how can create table, allows set info in name, if info matches info want allowed in name. bla1 or bla2.

create table table1 ( name varchar(23) name has 1 of them: ('bla1', 'bla2') )

try this:

create table table1 ( name varchar(23) check( name in ('bla1','bla2') ) );

sql database oracle

No comments:

Post a Comment