Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DB2 Query to fetch rows that contains spaces in columns

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
rajkumarmf1985

New User


Joined: 09 Aug 2010
Posts: 18
Location: bangalore

PostPosted: Thu Jan 31, 2013 3:36 pm    Post subject: DB2 Query to fetch rows that contains spaces in columns
Reply with quote

HI ,

I have to fetch the rows which contains the values like below.

RAJ KUMAR = there is one space between RAJ and KUMAR.

usually values will be like this. Now i have to fetch the rows which contains more than one space between the values in VARCHAR field column like below.

RAJA ##### VENKAT (# = space)
Can anyone please suggest how to get this...?

Thanks in Advance,
Raj kumar
Back to top
View user's profile Send private message

chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 269
Location: Mumbai

PostPosted: Thu Jan 31, 2013 4:18 pm    Post subject:
Reply with quote

Hi,

Try below sql

Code:
SELECT * FROM
TABLE NAME
WHERE LOCATE('  ',RTRIM(COLUMN-NAME)) > 0


First string in locate function is Twp Spaces as you need more than one space in column

Regards,
Chandan
Back to top
View user's profile Send private message
rajkumarmf1985

New User


Joined: 09 Aug 2010
Posts: 18
Location: bangalore

PostPosted: Thu Jan 31, 2013 5:07 pm    Post subject: Reply to: DB2 Query to fetch rows that contains spaces in co
Reply with quote

Thanks ..chandan It's working fine.
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 reg query on DYNALLOC feature raghuraman123 SYNCSORT 12 Wed Jan 10, 2018 2:42 pm
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 9 Thu Dec 14, 2017 3:52 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Can we combine the rows with same key... V S Amarendra Reddy DB2 12 Fri Dec 01, 2017 10:29 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us