Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Is it possible to replace a character within set of oracle records with update statement

Posted on 2011-09-28
5
341 Views
Last Modified: 2012-05-12
I need replace all  semi-colons with comma in a set of oracle reocrds in a particular field.  Is there a way to change an item in a record vs change the record.?

0
Comment
Question by:gilnari
  • 3
  • 2
5 Comments
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 36719816
If I understand this correctly it is a simple update:
update table_name set column_name=replace(column_name,';',',');
0
 

Author Comment

by:gilnari
ID: 36720026
I don't want to replace the column name,  I want to update a set of records where as example

john; smith
susize; cole

to
john, smith
susize, cole

0
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 500 total points
ID: 36720383
You are not replacing the column name.  You are replacing the data stored in the column.

As always, set up a quick test and test things.

Create table tab1(col1 varchar2(20));
Insert into tab1 values('john; smith');
Update tab1 set col1=replace(col1,';',',');
Select * from tab1;
0
 

Author Comment

by:gilnari
ID: 36814759
I love you guys and gals.  thank you again
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 36814799
As always: glad to help.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Oracle SQL 6 73
su - oracle could not open session 6 95
Retreiving column names in Windows but not in Unix 11 58
Row_number in SQL 6 33
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question