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 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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm


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