Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 30th, 2005, 05:44 PM
usualmind usualmind is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 53 usualmind User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 24 m 36 sec
Reputation Power: 4
Question Column Concatenation

I have two columns, one with first names and one with last names. I created a new column in the table called full_names. How would I go about concatenating the first and last names (first_name||' '||last_name) and place them in this new column?

Would I use an insert command of some sort?

Thank you!
Deanna

Reply With Quote
  #2  
Old March 30th, 2005, 07:48 PM
merl merl is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 51 merl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 34 sec
Reputation Power: 7
update table1
set full_name = substrb(first_name||' '||last_name, 1, 80);

The substrb is just to make sure that none of the names are longer than the length of the new column (in this example, 80)

Reply With Quote
  #3  
Old March 31st, 2005, 07:38 AM
usualmind usualmind is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 53 usualmind User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 24 m 36 sec
Reputation Power: 4
Quote:
Originally Posted by merl
update table1
set full_name = substrb(first_name||' '||last_name, 1, 80);

The substrb is just to make sure that none of the names are longer than the length of the new column (in this example, 80)


Thank you so much. The substring is a good idea.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Column Concatenation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT