|
View previous topic :: View next topic
|
| Author |
Message |
neelesht
New User
Joined: 24 Jul 2006 Posts: 99 Location: Los Angeles
|
|
|
|
Hi All,
I want to make sure that one of my table column always has a value (not spaces). I want to put a constrain that spaces can not be put in his column. I have defined it as NOT NULL and its an index.
Is there something called NOT SPACES in DB2 ? Just wondering !.
Thanks for the help.
Neelesh |
|
| Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
| Code: |
| CONSTRAINT ADDR_1C CHECK (ADDR_1 <> ' ') |
That will prevent a value of all spaces. |
|
| Back to top |
|
 |
Kjeld
Active User

Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
| Your database update will be rejected on this constraint. You will still have to add code to check for spaces and supply an alternative value, if abandoning a row insert is not an option. |
|
| Back to top |
|
 |
|
|