Solved

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

Posted on 2011-09-28
5
344 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
[X]
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
  • 3
  • 2
5 Comments
 
LVL 77

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 77

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 77

Expert Comment

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

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

734 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