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
Solved

How can I replace a particular string pattern in a word

Posted on 2013-06-25
3
231 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 77

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Via a live example, show how to take different types of Oracle backups using RMAN.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

828 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