p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   MySQL (http://p2p.wrox.com/forumdisplay.php?f=99)
-   -   Check values (http://p2p.wrox.com/showthread.php?t=39796)

Dj Kat March 14th, 2006 09:37 AM

Check values

I need to a contraint for a field,
I tried this line in a create table command

 project_klasse              char(5) NOT NULL default ''CHECK IN('A','B','C','D'),
This would only allow values a,b,c and d for project_klasse

does anyone know if this is possible in mysql if so what is the right synstax

__________________________________________________ ________
This is my junk I'm gona eat it

ciderpunx March 17th, 2006 08:20 AM

Yah, you can probably use an enum field see:



Don't Stand on your head - you'll get footprints in your hair

Dj Kat March 23rd, 2006 04:10 AM

thnx that seems to be the thing I'm looking for
Postgres Sql has this with check

__________________________________________________ ________
This is my junk I'm gona eat it

All times are GMT -4. The time now is 07:11 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.