Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to make cloumn not spaces.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: How to make cloumn not spaces.
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am
No new posts DFSORT VB File make 2 lines from 1 BridgetBrackenbury DFSORT/ICETOOL 2 Fri Feb 12, 2016 3:48 am
No new posts Remove intermediate spaces Pallavi Vishwanath SYNCSORT 1 Fri Jan 15, 2016 2:45 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us