IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to make cloumn not spaces.


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
neelesht

New User


Joined: 24 Jul 2006
Posts: 99
Location: Los Angeles

PostPosted: Wed Aug 25, 2010 11:44 pm
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Aug 26, 2010 12:24 am
Reply with quote

Code:
CONSTRAINT ADDR_1C CHECK (ADDR_1 <> ' ')


That will prevent a value of all spaces.
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Thu Aug 26, 2010 5:27 pm
Reply with quote

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
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To Unstring spaces in a field COBOL Programming 3
No new posts Make job wait until submitted job is ... JCL & VSAM 4
No new posts how to complete the end of a record w... DFSORT/ICETOOL 2
No new posts BPXBATCH SFTP to remote path having s... All Other Mainframe Topics 6
No new posts trying to make sense of keylists TSO/ISPF 11
Search our Forums:


Back to Top