Hi,
You can use a "domain":
create domain color as varchar default 'Black' check value in('Red',
'Green', 'Blue', 'Yellow', 'Black', 'White');
create table pixels(x int, y int, c color, primary key(x, y));
insert into pixels values(0, 0, 'Red');
insert into pixels values(0, 1, 'Green');
insert into pixels(x, y) values(1, 0);
insert into pixels values(1, 1, 'Error');
select * from pixels;
drop domain color;
drop table pixels;
If you want to avoid the space overhead in the table then you might
want to use a separate table for the colors. Also, you can create
constants ("create constant"). Other than that, I don't really want to
add a new "enum" concept unless many other databases also support it.
In my view, there are already plenty of ways you can solve the
problem.
Regards,
Thomas
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.