Solved

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

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
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.

761 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