Remove the schema from a string

Hello

I was wondering if there is any better way to do something like that?
SELECT 
    REPLACE( 
      REPLACE( 
        REPLACE(
          'SOMETHING .A .B .C Something else !', '.A',''),
        '.B', '' ),
      '.C', ''
    )
FROM DUAL;
This is just one example. My real case is a little more complex. So I would remove the. A. B. C. now I use REPLACE followed by the template should be deleted and I put an empty string as a replacement string. And it does the job properly. But I was wondering if there is another way that can avoid me using 3 Replace.

Thanks for your help,

user13117585 wrote:
Me being stupid again...

Sorry for this stupid question.

SELECT
TRANSLATE('SOMETHING .A .B .C Something else !', ' .A.B.C',' ')
FROM DUAL;

Not a stupid question at all. Assuming that you want only to remove the actual strings. A. B and. C, so it is actually more difficult than it sounds. Consdier:

SQL> SELECT TRANSLATE(x, ' .A.B.C',' ') xlate,
  2         REGEXP_REPLACE(x, '(\.A)|(\.B)|(\.C)') rexp
  3  FROM (SELECT 'SOMETHING .A .B .C Something else !' x
  4        FROM DUAL
  5        UNION ALL
  6        SELECT 'SAMETHING .A .B .C Another Bit !'
  7        FROM DUAL);

XLATE                               REXP
----------------------------------- -----------------------------------
SOMETHING    Something else !       SOMETHING    Something else !
SMETHING    nother it !             SAMETHING    Another Bit !

John

Published by: John Spencer, March 8, 2011 09:10
ADED the SQL instead of just the results

Tags: Database

Similar Questions

  • Remove the HTML from a string

    I have some data which are recorded by a rich text editor, but I need to display it in a datagrid without HTML tags.

    Someone at - it a regular expression for the elimination of all of the HTML in a string?

    Y at - it another way to do this in flex.

    Thank you

    Nevermind I found it. In case anyone is interested.

    [var myPattern: RegExp = /<[^>] * > / g
    txt = txt.replace(myPattern,"")

  • Unable to remove the user from database

    Hi all

    I'm unable to remove the user from the database and get the error shows:

    "must use DBMS_AQADM. DROP_QUEUE_TABLE to drop the queue tables"

    I find 3 table with AQ prefix in the schema, but unable to remove the table even using "sys" user.

    No idea how I can do?

    Kind regards

    Hello

    select object_name,object_type from dba_objects where owner='USERNAME' and object_name like '%AQ%';
    

    TO remove the table from the queue, sign in as the owner and

    exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'PASTE_THE_OBJECT_NAME_FROM_ABOVE',force =>TRUE);
    

    Anand

  • I had to get a new phone because I dropped one and damaged the screen how am I supposed to remove the information from the old phone if I'm not

    I had to get a new phone because I dropped one and damaged the screen how am I supposed to remove the information from the old phone if I don't?

    Are you turning in the Apple device, a company or the insurer? Can you turn on the device? If so, you could try to send a command to erase with iCloud. If this is not the case, if her deal with Apple, they he will wipe away. If the only damage the screen, you don't want just the screen replaced?

  • How can I remove the button from menu? The custom option doesn't seem to work for this.

    How can I remove the button from menu? [This IChing looking for three line on the toolbar icon].

    The tool bar Customize option doesn't seem to work, and it seems a waste to have a button that duplicates the menus. I would trade on the NoScript icon.

    Hi, I can not recommend that you do, but if you are really determined, this article can help.

  • I bought an iphone 4 on ebay but it's locked, icloud so I am not able to use it, and the previous owner is available to remove the device from their account: How can I use the appliance?

    I bought an iphone 4 on ebay but it's locked, icloud so I am not able to use it, and the previous owner is available to remove the device from their account: How can I use the appliance?

    You can not. Try to return the unit and get your money back. There is absolutely no way for you to unlock the device,

  • What do I have to remove the battery from my PC when I connect it with the cable?

    So that the battery do not damaged.
    What do I have to remove the battery from my PC when I connect it with the cable?
    Tell me what I need to do for that battery not damaged

    Hi mate,
    Don t worry, just use your machine and leave your battery in your machine, because an electronic load look at your battery, so no damage will be caused.

    You know, technology is in fact at a good level and I think it s ok to operate your machine with cables and battery SET. :

    Greetings

  • I was using iDownloaders browser and a message came your device is infected with a virus. I removed the app from my mini iPad 2 but now I feel crashes especially among angry birds. I want to restore, but I fear that the virus will reinstall.

    I used the iDownloaders app browser, (it is a video download application I use for a few years with no problems), when a message came "your machine is infected with a virus please leave the app and contact Apple." I removed the app from my mini iPad 2, but now I meet including crashes in Angry Birds Seasons and Rio. I want to restore the iPad, but I fear that the virus will reinstall themselves as well. Apple did not contact because I never heard of someone who got a virus using iOS. I took it slightly think to delete the iDownloader app would solve the problem. Im running version 9.2 on a retina mini iPad 2. Maybe someone has an answer on what I can try before you contact Apple. I appreciate any suggestions thanks JohnG

    Unless your iPad is jailbroken, it is not infected.  This notice is a well known scam to a fraudulent web site.  You can restore.

  • I can't unlock my iphone by apple ID knowing that the previous owner removed the device from his account, but still the unit asks the old code in order to unlock the phone

    I can't unlock my iphone by apple ID knowing that the previous owner removed the device from his account, but still the unit asks the old code in order to unlock the phone

    If the device is always ask for the ID of the previous owner, then it is has not been deleted.

  • Remove the tick from IPv6 network connection properties

    I need to remove the tick from the properties of the network connection for the element "Version of the Internet Protocol (TCP/IPv6)" or by a script or a registry setting. I found the articles for disabling or uninstalling IPv6, but I have a specific request to remove the tick. If it must be done manually, it is not a realistic solution with the amount of systems on the network.

    Does anyone have a solution?

    Hi Drooza999,

    Thanks for posting in the Microsoft community.

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the TechNet Forums.

  • When I try to remove the program from the toolbar of Verizon Broadband, he said "the toolbar DLL is not found."

    When I try to remove the program from the toolbar of Verizon Broadband it is said "the toolbar DLL not found, help

    We are not in a position to help unless you help by providing us with as much information as possible.

    Suggestions for asking for help on a site.

    http://support.Microsoft.com/kb/555375

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_other-windows_update/what-information-to-post-in-the-Windows-Update/1467f44b-ee27-4F7D-98d7-f1c4b35b3395

  • Having difficulty to remove the adware from my computer

    Yesterday I ran a search in google for winzip password recovery which led me to a website called . www zippasswordrecovery.com /. I have AVG Anti-Virus installed on my computer, so I thought that I was safe to download the file. However, once downloaded AVG detected a threat, so I put in quarantine. Apparently it installed on my computer, and of course annoying adware ads popped up whenever I went through Internet. I went to add or remove programs and found (file name is FREEzeFlip), and every time I try to remove it, my antivirus detects a threat and quarantines, preventing me to spend with the removal process. I did a scan with AVG which found nothing, then installed Malware Bytes, which found 6 threats which were all adware and supposed to be deleted successfully. I restarted my computer, browsed the web, and every time I visit a Web site, Malware Bytes gives the message "successfully blocked access to a potentially dangerous website 64.94.137.96 type: outgoing," I guess that's blocking a pop-up every time ad that appears. I went to add or remove programs and Malware Bytes gave essentially the same message as AVG and quarantine. I googled 'remove FREEzeFlip' and found this Web page with technical support information to remove the FREEzeFlip from the computer: http://webcache.googleusercontent.com/search?q=cache:yvW4QAnD1fYJ:freezeflip.com/support.html+remove+FREEzeFlip&cd=1&hl=en&ct=clnk&gl=us&source= www.google.com (click on text version if it does not load). It is very obvious that it is intentionally malicious because it says "If you continue to see the elements of the FreezeFlip program on your computer after following the steps in uninstalling above, your antivirus software blocks maybe uninstall completely." and that it proceeds then to tell you can uninstall your antivirus software, visit a link to download an uninstall program and restart your computer. LOL... these idiots...

    Thank you in advance for your help! Sorry for the long story, but I didn't leave out the small details that may be important.

    Help, please!

    Hi, use this program to uninstall got rid of him for me,

    http://www.revouninstaller.com/
    I got the link from yahoo answer, good luck
  • cannot open a session - tried to remove the computer from a domain

    XP pro SP3-

    My computer was an area where I logged on using a card chip.  I remove the computer from the domain and use it at home.  In the network dialog box, I changed from one domain to a home network and restarted by fashion.  Now, it's starting to use CTRL-ALT-DELETE, then a username and password that I did not and I do not have the opportunity to specify a field or use the smart card.  Blanks do not work.

    I want to undo what I've done and join the field, I can use the smart card and unlock the computer.  Any ideas how I can do this?  I can not use safe mode or get to the command prompt.

    Thanks JW

    I went hat in hand for people to support admin area and after going through a long list of their combinations of name/pw super secret they have finally found one that worked and were able to reconnect to the field.

    I intend to set up a new user with local newspaper on but all first I have to work around security policies when they me reconnected to the field.  I plan to permanently remove this computer from their LAN, who has started all this in the first place.  Pain in the neck for policy all number, disables USB (kill all external drives, including the optics I) etc.  I can fix it everything that it (still) was not aware of this bump on the road when I tried to switch on my home network.

  • I downloaded the Office Professional 60 day trial, this worked well. my trial is over and I would like to remove the software from my laptop but can not...

    I downloaded the Office Professional 60 day trial, this worked well. my trial is over now and I want to remove the software from my laptop, I tried to do it via Add/Remove programs in the control panel, but get the message "installation of the product has been damaged. Run Setup again from the original cd/dvd or other source of installation '. I looked for an hour on the Microsoft Web site to help but can't find... Please someone he can offer advice?... Thank you

    http://support.Microsoft.com/kb/928218

    "How to uninstall manually Office system 2007 if you cannot uninstall it by using the function" Add / Remove programs.

    Read and follow parts of the XP of the info on the link above to Ms.

    See you soon. Mick Murphy - Microsoft partner

  • How can I remove the file from the adware N10.adshostnet?

    How can I remove the file from the adware N10.adshostnet?

    How can I remove the file from the adware N10.adshostnet?

    Run adwcleaner.

    http://www.bleepingcomputer.com/download/adwcleaner/

Maybe you are looking for