Solved

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

Posted on 2011-09-28
5
339 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
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 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.

863 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now