replace all the ',' inside the string

I have a long string and pl/SQL, I want to replace all the ',' with ', null, '.

Can I use replace function as:
prepare_insert: = replace (prepare_insert, ', ', ', null,');

but it will not replace Prime ',' not all. How can I replace all?

It works fine in your case also.

',' replace will replace the first ',' to ', null, ', and then he would find the second ',' and to replace it ', null,'.

select replace(',,,,',',,',',null,') from dual;

,null,,null,

There is no combination of 2nd & 3rd "," for the replacement.
but only one, 1st & 2nd, 3rd & 4th. That's all.

Doing twice replace() will give you what you want:

select replace(replace(',,,,',',,',',null,') ,',,',',null,') from dual;

,null,null,null,

Published by: PhoenixBai on August 24, 2010 23:43

Tags: Database

Similar Questions

  • Find and replace all occurrences of a string within the current paragraph.

    I did so much work, and it's my last method to implement.

    I want to get the current active doc the current paragraph and replace all occurrences of a string inside this paragraph with another string.

    For example, say I have the following paragraph in a document:

    «This is a sentence that.» This is another sentence. It is also another sentence. The sentence ".

    If the user opens the document containing the paragraph and goes to this paragraph by clicking in any place in there, I want to replace e.g.g "another punishment" with "phrase.

    But only in the current active paragraph in the active document.

    I found a code with F_ApiFind and F_ApiGetTextRange to get the current text selection, but I can't think of a way to do it.

    Post edited by: Efstathios Chatzikyriakidis

    Problem solved people. Thank you.

  • Replace all the images in different format

    Hi all

    So I know just like the modification of some files by renamming or moving folder and open the project and then that it points to the new directory/whatever and which works very well.

    I help a friend who is sounding a customer is a mess and I need to find a quick way to solve this problem.

    Long story short, the poor kid turned on a redcam but had all converted files .mov 720 x 480 and published in first things. Well... The guys, its impossible to get an OMF from there so I got everything and it imported in first pro and started the repair of some of the bits upward and exported the OMF. Now I've discovered that the child always has the R3D files. so I would replace all the files to .mp4 and .mov in this project to the eponymous r3d with just the extension of r3d.

    Feeling when I tried to move the other files and start to replace I had to manually locate each r3d and which would take forever...

    I want to change the files of much better quality ones, a good installation sequence, keeping its changes and then speedgrade for him but I'm not willing to invest the time to manually replace each file.

    any ideas?

    You may need to do this one at a time if each R3D file is in its own folder.

  • How can I replace all the bookmarks menu with another menu of firefox from another computer

    I installed an old Firefox bookmarks, install files by mistake on a new Linux Mint.
    How can I remove the old menu bookmarks and install the new file menu?
    Firefox OS 35 - Mint 17
    Thank you

    You can restore a JSON backup — a backup in the folder bookmarkbackups Firefox automatically creates, or you create a backup.

    Restore a JSON backup will replace all existing bookmarks in contrast to import an HTML backup that merges with existing bookmarks bookmarks.

  • How can I remove and replace all THE contacts on my iPhone 6 s

    I just got a new iPhone 6s and had my contacts migrated to she an old HTC Android phone at the office of my carrier. Migration not be passed not as planned and all my contacts are screwed up. I would like to delete all contacts and replace them in the good list which is on my MacBook Pro. How is the best way to do it? FYI, I'm long (Senior) Mac user, but a smart phone for novice user. Once I get the old deleted contacts, can I do a direct link to my MacBook via USB? Or should I create an Archive of my contacts and somehow get in the cloud and download it from there? Thanks in advance for your help.

    I fixed this problem myself. Here's how I did it...

    (1) on my new iPhone 6s, I went to settings > iCloud > Contacts and turned on OFF.

    (2) then I went to my MacBook Pro > address book. In my address book on the left hand side there was a list called "ICloud all.» I selected all the contacts in this list and deleted (it has not deleted the list "on my Mac".)

    (3) I went back to my iPhone settings > iCloud and turned the "Contacts" button. Back to my phone button and selecting 'Contacts' verified that there is no left of Contacts on my iPhone.

    (4) go back to my MacBook > addressbook, I copied the 'groups' I wanted to list "all iCloud.

    (5) I did a "hard reboot" on my iPhone and Voila! -all my contacts are now on my iPhone and I could turn the groups on or off because I am pleased.

    NOTE: I could have done the same thing except in step (4) above, I could have copied 'All the Contacts' in the field 'Cloud of all', but I wanted to only certain groups on my phone.

    I hope this helps others with the same problem.

  • Photosmart 7520: my photosmart HP 7520 do not print: I replaced all the cartridges and always use HP ink cartridges

    My 7520 gives me a message that says: "there is a problem with the printer or ink system. Turn the printer off, then on. If the problem persists, contact HP. »

    It was printing fine, but then it looked like it was getting low on ink. Black began to turn gray and striated. I replaced all ink cartridges. NOTE: I ALWAYS use cartridges HP, new out of the box. I followed your instructions step by step on the site, but it seems to be moot, since I tried everything. I will be so angry if I spent $ 70 on new HP to put in this printer ink and she took a dive. Please suggest solutions. I really should get this impression, am on a deadline.

    I work with a MAC OSX El Capitan system

    Hello

    I suggest remove you the printer cartridges

    Turn on the printer without cartridge. It should start and see the lack of ink.

    now, first install black and see another error.

    If this isn't the case, restart the printer and do the same for the rest of the inks

    She solves the problem or help to identify the defective

    It may be useful

  • How to replace all the Bridge CS6 Stock keywords with Bridge CS5 keyword

    I have CS6 working in a computer other than the one which houses the CS5. CS6 bridge can read CS5 keywords when it opens a 'old' photo but there not his own (not counting the stock of those supplied with the program). How can I replace all keywords CS6 stocks with the key words of CS5?

    Have you tried the Import/export options in the little menu in the top right of the keywords Panel?

  • Replace all the text in the text book example

    Hello comrades,.

    Is there a way to replace all text content in a book with some sample text using Extendscript?

    If so, could you please point me to the relevant API?

    Thank you in advance for your help!

    OK, I thought about it. Here's a script that works through all the text in the main stream after opening the document.

    var oDoc is app. ActiveDoc;

    var oDoc.TextSelection = oRange;

    var oPgf = oRange.beg.obj;

    var oTLoc1 = new TextLoc;

    var oTLoc2 = new TextLoc;

    var renounce = new TextRange;

    var sNewTxt;

    While (oPgf.ObjectValid ())

    {

    var oTexts = oPgf.GetText (-1);

    oTLoc1.obj = oPgf;

    oTLoc2.obj = oPgf;

    for (i = 0; i< otexts.length;="" i++="" )="">

    If (.dataType oTexts [i] == Constants.FTI_String) {}

    oTLoc1.offset = oTexts [i] risk;

    oTLoc2.offset = oTexts [i] + oTexts [i].sdata.length risk;

    oTRange.beg = oTLoc1;

    oTRange.end = oTLoc2;

    oDoc.TextSelection = renounce;

    oDoc.Clear (0);

    sNewTxt = oTexts [i].sdata.replace (/ [a - z] / g, 'x');

    sNewTxt = sNewTxt.replace (/ [A - Z] / g, 'X');

    oDoc.AddText (oTLoc1, sNewTxt);

    }

    }

    oPgf = oPgf.NextPgfInDoc;

    }

  • Why mozilla firefox options synchronization replaces all the new password old password?

    When I sign in account twitter, linkedin, facebook and yahoo all sites informs me that you used your old password? I have change my password all the old almost 5 months before and after 5 months I used Firefox sync my new bookmarks update option, new name of connection sites and new passwords as well, but after that the sync option used, my new password replaced with the old password

    Maybe the 5 month period when this laptop principal was not connected to the Sync had a role to play in your problem. Sync is designed to synchronize Firefox data permanently, not to be started when you want to "data backup", as with a Cloud Computing service. And the password / feature connections has been changed just about this time, I remember well, then maybe who had a role to play in this last issue.

    1. my advice is to unplug all devices sync. 2. then, using computer laptop main with your latest data, reset your synchronization password. Will erase your data from the server, so you can get a fresh load of data to synchronize, and then to other devices when you connect again with the new password. 3 reconnect the computer main sync using the new password. 4. the next day reconnect another device using the new password. Check that connections data is now suitable for this device. 5. If it looks good, plug other devices one by one at a time by using the new password. And if you are using a "mobile version" of Firefox [Firefox for Android or Firefox for iOS] I would wait a few days to make sure that your data on the desktop / computer portable devices is good before you plug one of these devices.

  • Replace a string variable value (replace '&amp;' in the string at 26%)

    Hi all... I have a question... .we form a url that has a field of string with "&" in its value example: ST & G... the url is slightest mistake out. However, if we replace this value by ST % 26G it works as expected. I tried to replace ('ST & G', '&') it asks to enter the value of substitution and exit ST not what I need... I need the output to % 26G ST. Please suggest.

    There is an API for this task: UTL_URL

    However, the parameter that handles the reserved characters unescaping is Boolean data type and is false by default, so you can call it only of PL/SQL:

    SQL> begin
      2    dbms_output.put_line( utl_url.escape('ST&G', true) );
      3  end;
      4  /
    
    ST%26G
    
    PL/SQL procedure successfully completed.
    
  • Blank.gif replacing all the images in a slideshow

    Since the last update, I decided to redo a site for a client. In any case...

    No matter what I do when I export via FTP or HTML page and download the slide show via an ftp server does display all images, only Blank.gif (1 x 1).

    I have a slide show of work on another page (I copied on but still no luck).

    the bottom of the page is also on 500px to the end of the page that is not more in the design.

    [site has been updated across all updates from muse] I rebuilt the site on a new doc with the same question.

    Thank you chris

    link to site

    http://www.workhouse-England.co.UK/

    slideshow of work

    http://www.workhouse-England.co.UK/workhouse-England--autumnwinter-16.html

    We need the .muse file because that's where your code for this slideshow is maintained... I don't want the entire site.

    • Open your site in Muse,
    • GoTo file > save as > and save the site as a new .muse file
    • Open this new file, the muse and delete everything that is not part of the two slide shows with questions
    • Save the .muse (again, only two slideshows) and upload it to a kind of drop box, so we can pick up
  • HP Officejet 6500 E709n Series (replaced all the cartridges and the printer does not print in color).


    The upper part and let the carriage to move to the Center or the left, unplug the printer, remove the ink cart. poser pose on the side, hands gray and remove the printhead with a lint or a coffee filter, hormonaly moisten her and essuyer wipe down the contacts at the back of the print head, wipe were also the printhead sits in the printer, reinstall the print head and ink cart., close the cover, don't hold the #3 on the front of the printer and the plug the unit back in When you download release power the #3 and see if that helps the issue.

  • JavaScript exception: error calling the function of selection: [object error] after the last update of the software Adobe Muse.  I export the html files and load them on my server.  I replaced all the files.  Only happens in IE11

    error.png

    UPGRADE to someone else who may have had this problem.  It's in compatibility mode settings.  Went in IE-tools and unchecked the option to view websites in compatibility mode, also went in the developer tools and changed the document aboard 11 mode.  This fixed the error!

  • replacement of the same value in a string variable values

    If I have a string:

    "%s is %s that I'm talking about."

    and - I want to replace the instances with DIFFERENT values %s... What is the best way to do it.

    I thought of her analysis in separate using substr and instr chains, but I don't know if that's an exaggeration or not.

    Replace is ideal but - it replaces all occurrences of if - you can indicate just replace the first occurrence of a value, and the second with one another (i.e. If the result after replacement of the string above was supposed to be "it's the chain that I'm talking about"

    Any help is appreciated.

    Thank you

    Hello

    wtlshiers wrote:
    If I have a string:

    "%s is %s that I'm talking about."

    and - I want to replace the instances with DIFFERENT values %s... What is the best way to do it.

    Whenever you have any questions, please post CREATE TABLE and INSERT statements for some examples of data and the results desired from these data.
    Explain how you get these results from these data.
    Always say what version of Oracle you are using (for example, 11.2.0.3.0).
    See the FAQ forum {message identifier: = 9360002}

    I thought of her analysis in separate using substr and instr chains, but I don't know if that's an exaggeration or not.

    Depending on your needs, you may need to do this.

    Replace is ideal but - it replaces all occurrences of if - you can indicate just replace the first occurrence of a value, and the second with one another (i.e. If the result after replacement of the string above was supposed to be "it's the chain that I'm talking about"

    As you say, REPLACE replaces all occurrences. There is no way to say (for example) to change only the first.
    REGEXP_REPLACE, is much more flexible. There is no option for giving a specific occurrence, but you won't even have this feature. You want maybe just something like

    REGEXP_REPLACE ( '%s is the %s I am referring to'
                , '(.*)%s(.*)%s(.*)'
                , '\1This\2string\3'
                )
    

    Depends on your data and your needs.
    Are the new values (e.g. 'This' and 'chain') fixed, or if they can change from one line to the other?
    You will always have 2 (or certain known number) of ' %s in the original string?
    '%' Always report something that needs to be replaced? If not, how can you tell when he does and when it doesn't?
    Of ' always come right after "%"? If this is not the case, what are the possibilities, and what the different characters?

  • Adobe has replaced all of the icons with the Adobe icon when I try to open programs.

    How I would fix a problem where adobe has replaced all the icons with an adobe icon and when I open the adobe programs is where I must say that it can't open the program?

    Always, always, start by telling us what operating system you use to describe your problem.

    Use it for Vista...

    http://www.Vistax64.com/tutorials/233243-default-file-type-associations-restore.html

    Scroll down to exe - executable application files.
    Click on the exe

    Follow the instructions in #1 à #7 at the top.

    Scroll to lnk - shortcut link (LNK) files.
    Click on lnk

    Follow the instructions in #1 à #7 at the top.

    For Windows 7, use this:

    http://www.SevenForums.com/tutorials/19449-default-file-type-associations-restore.html

    Scroll down to exe - executable application files.
    Click on the exe

    Follow the instructions from #1 to #6 in the upper part.

    Scroll to lnk - shortcut link (LNK) files.
    Click on lnk

    Follow the instructions from #1 to #6 in the upper part.

Maybe you are looking for