REGEXP_SUBSTR - using nth occurence, how can I include null?

Hi
Running the following:
select REGEXP_SUBSTR('1|2|3|4|5||7|8|9|10','[^|]+', 1, 5) from dual
UNION ALL
select REGEXP_SUBSTR('1|2|3|4|5||7|8|9|10','[^|]+', 1, 6) from dual
UNION ALL
select REGEXP_SUBSTR('1|2|3|4|5||7|8|9|10','[^|]+', 1, 7) from dual
UNION ALL
select REGEXP_SUBSTR('1|2|3|4|5||7|8|9|10','[^|]+', 1, 8) from dualGives:
5
7
8
9
How can I get it to produce:
5
7
8
Please?
In other words, I want to not skip the null.
Thanks

Perhaps using a replace of || to | | in the statement will do the trick :)
I want to avoid writing a procedure.You have problems on inputs with | as first character too, replacing || with | | won't solve that problem. That's why I suggest you to don't try that way.
The solution I posted before, the one using regexp_replace instead of regexp_substr, was good for it.
Processing ...
with input as (
          select '|2|3|4|5||7|8|9|10' as chars
          from dual
     ),positions as (
          select 5 as pos
          from dual
          union all
          select 6 as pos
          from dual
          union all
          select 7 as pos
          from dual
          union all
          select 8 as pos
          from dual
select regexp_replace(chars,'^([^|]*\|?){'||to_char(pos-1)||'}([^|]*).*$','\2'),
     nullif(regexp_substr(replace(chars,'||','| |'),'[^|]+',1,pos),' ')
from input
     cross join positions
Query finished, retrieving results...
    REGEXP_REPLACE(CHARS,'^([^|]*\|?){'||TO_CHAR(POS-1)||'}([^|]*).*$','\2')           NULLIF(REGEXP_SUBSTR(REPLACE(CHARS,'||','||'),'[^|]+',1,POS),'')      
5                                                                                                                                                            
                                                                                 7                                                                           
7                                                                                8                                                                           
8                                                                                9                                                                           
4 row(s) retrievedBye Alessandro

Similar Messages

  • How can I include results of a subsequenc​e, which runs in a new thread, in the main sequence test report

    Hi!
    I', m working with TestStand Version 4.2.1. I have a main sequence, which calkls different subsequences. All these steps are properly reported. One of subsequences runs as "new thread". How can I include its results in common test report of the main sequence?
    I have markes variables of the subsequence as it is requred for test report (it works OK if it is not a new thread). If the the numerical test, which is executed in this subsequence is correct, I get no results at all. If the numeric test failed I get somewhere in the main sequence report a "red message", that test failed whithout any reference to the step or values of vaiables which were not correct.
    I tried an option "On the fly" in the Report Configuration , but haven' got any useful results. What shall I do?
    Best regards
    Solved!
    Go to Solution.

    Hi,
    I tried it but without success:
    1) I got a reference to the Thread as "Locals.Step1=RunState.Thread" for every of 2 steps which start a thread
    2) I put both "Waits" after steps with (and without) threads, at the same place, where they were before
    3) The sequence run OK, but when it came to Wait for Thread 1 it waited for ever, I had to terminate sequence
    Does it mean, that I got a false reference (suppose No - please, have a look at attached pic)?
    Or does it mean, that Waits are badly placed in the sequence (threads are already terminated)? Here is a pic of sequeces calls with Wait after them.
    Regards
    Attachments:
    Thread.JPG ‏34 KB
    SequenceCall.JPG ‏32 KB

  • How can I include a success message in a drag and drop interaction - I don't see this option in the Actions on success options, and cannot figure it out?

    How can I include a success message in a drag and drop interaction - I don't see this option in the Actions on success options, and cannot figure it out?

    I suspected you used the eye icon on the timeline to hide the message, but that one has no impact whatsoever on the published version. It is only meant to be used for editing reasons on the stage, to hide objects temporarily on a crowded stage. It is confusing, certainly in CP8 where for both instances the same eye icon is used. In previous versions the Properties panel had a checkbox for 'Show in Output', which was IMO much clearer than this eye icon. But of course, that is only my personal opinion.

  • Smartforms: how can I include a jpg picture stored an a web server ?

    I want do include a business graphic (JPG) in a smartforms window. The picture is created by a web serves and stored on a web server.
    the jpg-picture can be loaded on by an http-adress.
    How can I include the picture in the smartforms form ?
    thanks
    Richard

    hi,
    use transction SE78 to upload the picture .
    Then use it in smartforms.
    regards,
    guru

  • How can I include merged projects in the printed documentation?

    I have a master project with several merged projects. This works splendid with online documentation, but when I am asked to provide a printed version, it seems I have to create separate documents for each merged project.
    Is there any setting or fix that enables print also of merged projects and topics when I create printed documentation?
    Pretty please with sugar on top :-)

    Hm - there is a contract with the customer, saying that he wants documentation both as word and pdf, and as we now aim at only writing online documentation, these tasks create extra work, as we are delivering updates each month
    But yes - two beasts, where only chm is actually needed we think.
    -Tone
    Date: Tue, 3 May 2011 06:53:04 -0600
    From: [email protected]
    To: [email protected]
    Subject: How can I include merged projects in the printed documentation?
    Hi there
    I'm a bit curious as to the reasoning behind your "persuation process for using chm-files only".
    CHM files and printed documentation are two entirely different beasts.
    Cheers... Rick
    | http://www.robowizard.com/pc.gif | Helpful and Handy Links
    http://www.Adobe.com/cfusion/mmform/index.cfm?name=wishform&product=38
    http://www.gooberguides.com/ProductPages/RoboHelp/RoboHelp82Day.htm
    http://www.ShowMeSolutions.biz
    http://sorcererstone.wordpress.com/
    http://www.gooberguides.com |
    >

  • How can I include a portal component look and feel in a java servlet

    Does any body know how can i include a portal component look and feel (tables, buttons, etc) in a java servlet?

    Hi José,
    I don't think that is possible. But you can import the css files that ep uses for its look and feel and try to give your web pages similar look and feel. The tables and other controls used in EP are totally different and are done through complex JavaScript coding instead of simple HTML tags. If you want exact lok and feel then i thin you must go for a Webdynpro based application rather then a J2EE application with JSPs.
    Regards,
    Guru.
    PS: Give points for helpful replies.

  • How can i include a sampling of type in ps7 type tool?

    how can i include a sampling of type in ps7 type tool?   i did this in ps3

    I guess in my zest to answer your question i had forgotton about Adobe Type Reunion.
    What operating system are you using photoshop 7 on?
    photoshop 3.05 on mac os 7.6.1

  • How can i include Services and Bindung in a generated WSDL file?

    Hi,
    i what to use a generated wsdl file from an erp system, to build a web service client with WSDL2Java (org.apache.axis.wsdl.WSDL2Java).
    I noticed, that services an bindings are missing, also a policy is included.
    How can i include services and bindings in the wsdl and exclude the policy?
    Thanks!

    well, I assume you have SOAMANAGER.
    choose your service & "Apply Selection" (very useless button btw)
    select a binding in the dropdown box or create on if you do not have one yet
    Click button "Show WSDL options" (actually they do not really look like buttons in WD; call it yellow blot)
    Some extra config area is thrown onto your screen (without any sense for usability or design); Change the radio button for WSDL format from "WS policy" to "Standard"; make sure the first radio button group is on "True" for monolithic
    Now click the link (why is this a link and no blot?) called "Display selected bindings WSDL URL"
    an extra text field is again thrown onto your screen somwhere between the dropdown and the WSDL option config area containing an URL (get out your glasses if you don't see the sub-10pt-letters)
    hope it helps,
    anton

  • How can I include 3rd party jar files with my custom extention?

    I'm writing an extension that is dependent upon some 3rd party jars. How can I include/package these with my extension?
    we're using the 11g tech preview
    thanks,
    Dylan

    Do you mean that you need these files to appear in JDeveloper as a library available for the developers who build a project and use your extension?
    You can create a library in JDeveloper with JAR files by simply adding the following to your extension.xml file:
    <jdeveloper-hook xmlns="http://xmlns.oracle.com/jdeveloper/1013/extension">
    - <libraries xmlns="http://xmlns.oracle.com/jdeveloper/1013/jdev-libraries">
    <library name="My Extension Library">
    <classpath> ${ide.extension.install.home}/lib/some.jar</classpath>
    </library>
    </jdeveloper-hook>

  • How can I include text lines in Service Invoice?

    Dear Experts,
    I realized unlike Item Invoice, Service Invoice does not have the "Type" column for me to include Text into the document?
    How can I include a free text into 1 row of the Service Invoice? without any GL Account, Qty and Total input?
    Thanks!
    Warmest Regards,
    Chinho

    Hi Chinho,
    Try to use the Description(100 characters) Field
    but if you want to add more characters at row level in single field.
    Try to add a UDF(500 Characters) on Marketing Documents.
    Regards,
    Madhan.

  • How can I include local fonts in my finished edge reflow website?

    How can I include local fonts in my finished edge reflow website?
    The website has to run without internet connection and the use of webfonts. I have already tried to to include fonts manually but this wasn't working.

    I would like this too, as it would save a lot of time using icons in the form of icon fonts.

  • How can we include the property value into the News RSS?

    We have defined object property u201CDepartmentu201D that is used in News XML creating form. How can we include the property value into the News RSS (set value of the particular RSS XML tag)?

    We have solved the issue with NWDS

  • I am experiencing problem (the installation does not start) when I try to install ArchiCAD 17 Educational on my mac. I am using Yosemite. How can I fix it?

    I am experiencing problem (the installation does not start) when I try to install ArchiCAD 17 Educational on my mac. I am using Yosemite. How can I fix it?

    You need to contact the developer/manufacturer directly to determine if their product is compatible w/Yosemite.  It is not listed on their system requirement website:
    Mac OS X 10.9 Mavericks
    Mac OS X 10.8 Mountain Lion
    Mac OS X 10.7 Lion
    Mac OS X 10.6 Snow Leopard*
    Note: ArchiCAD 17 is the last version of ArchiCAD to support Mac OS X 10.6
    Only case insensitive file-system volumes are supported.
    http://www.graphisoft.com/support/system_requirements/archicad17.html

  • How can I include my business email fonts on the ipad signature?

    How can I include my business email fonts on the ipad signature?

    It's a lot easier with Photo Manager Pro.
    https://itunes.apple.com/sg/app/photo-manager-pro/id393858562?mt=8

  • Label Printing Using Address Book - How can I Print multiple labels of the same name?

    Label Printing Using Address Book - How can I Print multiple labels of the same name?

    I used to be able to print multiple copies of the same picture on one page using iphoto. There was a customise button when you went through to print and it was there somewhere. I can't see it anymore - maybe since an upgrade.
    It's gone. But as a work-around, duplicate your photo (⌘D) to create as many versions as you want copies and select all at once. Then use the "Custom" print layout and set the photo size you want.
    After printing, trash the added versions.

Maybe you are looking for

  • XML Publisher report default output in Excel format.

    Hi, We have defined one concurrent program whose output format is text, this concurrent program executable is PL/SQL and in this PL/SQL program we are generating XML data and displaying XML using below fnd_request. l_conc_id := FND_REQUEST.SUBMIT_REQ

  • How To Register/Sign Up For The Forum - Video

    You can search for available solutions in the Forum as much as you want. However, if you need to ask a question in the forum or answer to somebody's post, you need to be a member of the community. It is very easy to register in our Forum and the new

  • Error in Restricted Room

    Hi,    I am getting the error as below when moving from Collaboration -> Rooms -> Room Directory. Although the user have super_admin_role, pcd:portal_content/specialist/Collaboration/com.sap.netweaver.coll.Collaboration, pcd:portal_content/specialist

  • Jcontrol.exe not starting.

    Hi all, We have a java stack N01 on our machine. We are unable to start the server successfully.. Problem is jcontrol.exe is not starting. Its status is "Some Processes running" all the time. In the AS JAVA Process Table of SAPMMC:::::  SDM is starti

  • Bug in work flow jsps

    Hi, i have a element in xsd which has maxoccurs = unbounded. When i use this as a parameter for one of the human tasks ,auto generate the form and deploy it on PM, i dont see any text box appearing for the unbounded element, The jsp has a method to g