Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How can I replace a particular string pattern in a word

Posted on 2013-06-25
3
Medium Priority
?
235 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
[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 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 1200 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

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.
We are witnesses that everyone is saying that our children shouldn't "play" with a technology because it is dangerous. This article is going to prove that they are wrong.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

618 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