MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

fetch only spaces in between fields

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
radkrish
Beginner


Joined: 12 Aug 2005
Posts: 102
Topics: 19

PostPosted: Tue May 08, 2007 12:16 pm    Post subject: fetch only spaces in between fields Reply with quote

My requirement is to fetch only records which have spaces in between the field value.
Eg.,
Code:

Sub-num 

35 8459
A24 809
4546657
2534675
356 890

result should be :
Code:

35 8459
A24 809
356 890

Can anyone help me to write the above logic using DB2.

regds,
radkrish
Back to top
View user's profile Send private message
CraigG
Intermediate


Joined: 02 May 2007
Posts: 202
Topics: 0
Location: Viginia, USA

PostPosted: Tue May 08, 2007 12:36 pm    Post subject: Reply with quote

Assuming DB2 try this
Code:

select * from table
WHERE POSSTR(STRIP(SUB_NUM), ' ') <> 0;
Back to top
View user's profile Send private message
radkrish
Beginner


Joined: 12 Aug 2005
Posts: 102
Topics: 19

PostPosted: Tue May 08, 2007 2:06 pm    Post subject: Reply with quote

Thanks, Craig.

regds,
radkrish
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Wed May 09, 2007 12:08 am    Post subject: Reply with quote

You can try this.

Code:
SELECT SUB_NUM FROM TABLE
WHERE SUB_NUM LIKE '% %';
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group