Solved

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

Posted on 2011-09-28
5
338 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)
Comment Utility
If I understand this correctly it is a simple update:
update table_name set column_name=replace(column_name,';',',');
0
 

Author Comment

by:gilnari
Comment Utility
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
Comment Utility
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
Comment Utility
I love you guys and gals.  thank you again
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
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.

Join & Write a Comment

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
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, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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.

772 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

11 Experts available now in Live!

Get 1:1 Help Now