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
 
How to extract data from a single column and put in 2 column

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

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Wed Jun 03, 2009 9:59 am    Post subject: How to extract data from a single column and put in 2 column
Reply with quote

hi,

iam writing a query to fetch the name of a customer.I have to fetch the name as First Name, Last Name.But the table contains only the Name Column which is a combination of First Name and Last Name.Is there any way to extract this data in DB2 into 2 different columns as First and Last name from the table.Please note that I do not have these details in anyother table.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jun 03, 2009 10:05 am    Post subject:
Reply with quote

Hello,

You might consider writing the query to return the combination name to some host variable and then within the program decompose the combination to the individual name parts.

There are far better options for data manipulation in code rather than trying to get all of the work done in some query.
Back to top
View user's profile Send private message
shchan

New User


Joined: 06 Jun 2007
Posts: 58
Location: Hyderabad

PostPosted: Wed Jun 03, 2009 12:51 pm    Post subject:
Reply with quote

Thanks dick scherrer...
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Jun 03, 2009 7:18 pm    Post subject: Reply to: How to extract data from a single column and put i
Reply with quote

You're welcome - good luck icon_smile.gif

d
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 Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm

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