Oracle 10g remove character from string

Posted on 2012-08-21
Last Modified: 2012-08-21
I have a series of values in my tables that contain an unwanted ‘#’ character. I need to remove it.
All affected values start with ‘P-# and look like P-#nnnnnnnn  where nnn is a random number.
How can I remove the #  so the value results in ‘P-nnnnnnn’
Question by:JDCam
    LVL 73

    Expert Comment

    update your_table set your_column = replace(your_column,'#')
    LVL 73

    Accepted Solution

    you could add a where clause too

    update your_table set your_column = replace(your_column,'#')
    where your_column like 'P-#%'

    Author Closing Comment

    Worked great ... thanks

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Introduction A previously published article on Experts Exchange ("Joins in Oracle", makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
    Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
    This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
    This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not 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

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now