Solved

How can I replace a particular string pattern in a word

Posted on 2013-06-25
3
230 Views
Last Modified: 2013-06-25
I have a coumn which can have values ‘aw45t/P76/002’, ‘aw45t/P54/002’,
I will like to replace any occurrence of /P##/ with /P99/

DB: Oracle 10g
0
Comment
Question by:diteps06
3 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 300 total points
ID: 39275491
Try:

UPDATE table
SET column = REGEXP_REPLACE(column, '/P[0-9][0-9]/', 'P99');

Open in new window

0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39275542
Typo correction and small alternative change:
REGEXP_REPLACE(column,'/P[0-9]{2}/', '/P99/')
0
 
LVL 1

Author Comment

by:diteps06
ID: 39275561
Thanks for the fast and precise answer
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

Suggested Solutions

Title # Comments Views Activity
Oracle Syntax 8 56
Oracle - Create Procedure with Paramater 16 56
Oracle SQL syntax check  without executing 6 34
database upgrade 8 39
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 …
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…
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to recover a database from a user managed backup

911 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

22 Experts available now in Live!

Get 1:1 Help Now