Problem with REGEXP_SUBSTR and the desired results

I have table like below:
USERNAME
DOCNAME
DESCRIPTION
user1
doc1
yes|no|none
user1
doc2
ok|not
user1
doc3
allryt
Now I want to display the table like below:
USERNAME
DOCNAME
DESCRIPTION
user1
doc1
yes
user1
doc1
no
user1
doc1
none
user1
doc2
ok
user1
doc2
not
user1
doc3
allryt
Now this is the query which I am executing to separate the rows:
SELECT a.*, REGEXP_SUBSTR (description, '[^|]+', 1, LEVEL, 'i') val
                 FROM (SELECT * FROM sample_table  WHERE username='user1') a
           CONNECT BY LEVEL <=
                         REGEXP_COUNT (description, '[^|]+')
But I am getting results like below (rows getting duplicated)
user1
doc1
yes|no|none
yes
user1
doc1
yes|no|none
no
user1
doc1
yes|no|none
none
user1
doc2
ok|not
not
user1
doc1
yes|no|none
none
user1
doc2
ok|not
ok
user1
doc1
yes|no|none
no
user1
doc1
yes|no|none
none
user1
doc2
ok|not
not
user1
doc1
yes|no|none
none
user1
doc3
allryt
allryt
user1
doc1
yes|no|none
no
user1
doc1
yes|no|none
none
user1
doc2
ok|not
not
user1
doc1
yes|no|none
none
Can anyone correct my query or modify it?

Try this
SQL> with t
  2  as
  3  (
  4  select 'user1' user_name, 'doc1' doc_name, 'yes|no|none' descr from dual union all
  5  select 'User1' user_name, 'doc2' doc_name, 'ok|not' descr from dual union all
  6  select 'user1' user_name, 'doc3' doc_name, 'allryt' descr from dual
  7  )
  8   select user_name
  9        , doc_name
10        , regexp_substr(descr, '[^\|]+', 1, level) descr
11     from t
12  connect by level <= length(descr) - length(replace(descr, '|')) + 1
13      and descr = prior descr
14      and prior sys_guid() is not null
15    order
16       by user_name
17        , doc_name
18        , level;
USER_ DOC_ DESCR
User1 doc2 ok
User1 doc2 not
user1 doc1 yes
user1 doc1 no
user1 doc1 none
user1 doc3 allryt
6 rows selected.

Similar Messages

  • I'm having problems with iPhoto and the facebook set-up.  Every time I attempt to do so it says an error has occured and try again later.  I have not seen a solution posted.  Therefore, how does one contact Apple to solve the problem?  I'm new to the worl

    I'm having problems with iPhoto and the facebook set-up.  Every time I attempt to do so it says an error has occured and try again later.  I have not seen a solution posted.  Therefore, how does one contact Apple to solve the problem?  I'm new to the world of iMac but I find it a bit frustrating trying to solve basic issues/problems:(

    For what it's worth, you posted this in 2011, and here in 2014 I am still having this same issue. Over the last two days, I have had to unlock my apple account 8 times. I didn't get any new devices. I haven't initiated a password reset. I didn't forget my password. I set up two factor authentication and have been able to do the unlocking with the key and using a code sent to one of my devices. 
    That all works.
    It's this having to unlock my account every time I go to use any of my devices. And I have many: iMac, iPad, iPad2, iPad mini, iPhone 5s, iPod touch (daughter), and my old iPhone 4 being used as an ipod touch now.  They are all synced, and all was working just fine.
    I have initiated an incident with Apple (again) but I know they are just going to suggest I change my Apple ID. It's a simple one, and one that I am sure others think is theirs. I don't want to change it. I shouldn't have to. Apple should be able to tell me who is trying to use it, or at least from where.
    Thanks for listening,
    Melissa

  • Mountain Lion fails to install saying it cannot create the recovery; I had a similar problem with Lion and the Apple Store that helped me resolve it gave me an installable version of Mountain Lion on a flash drive for my inconvenience....

    Mountain Lion fails to install saying it cannot create the recovery; I had a similar problem with Lion and the Apple Store that helped me resolve it gave me an installable version of Mountain Lion on a flash drive for my inconvenience....is there some trick I am missing or do I need to make an appointment with a genius...

    I have the MacIntosh volume and the Boot Camp partition only.  I know that when I installed Lion, I had to go through a whole back-up and recovery of Windows and then re-format the drive. 
    The tech at the Apple Store had a previous life as a MSCE and was very helpful.  I believe he even said that I should not have htis problem with Mountain Lion which is why they gave me the flash with it onboard.  I was in the process of starting a new job when I went to Lion, so I have waited to do this next and probably last upgrade to this old MBP since I doubt Apple will support this MBP in Maverick. 
    I do not have another installation, so that is not an option.  I will try to create an external, I have plenty of hard drives around and see if I can get it done that way.  It might take me a week or two to get back to it, but I will comment back upon completion of that effort.  Thanks for your help....Dave Iverson

  • Are there any known problems with Macs and the mp3 playback in Adobe Connect ?

    One user using an Apple Mac has complained of not being able to hear the mp3 sound playback in a meeting.
    Is this a problem with Apple Mac and mp3 compatibility or is it an individual soundcard issue ?

    I use several Macs with Adobe Connect and I have even created MP3 files for playback in the room. Works fine on all my macs. It's basic Flash. Suggest they clear their browser cache, replace their host-add-in if using one. Run the audio wizard as well to make sure sound is working in Connect.
    All of the Adobe Connect Government engineers use Macs all the time so we've never had an issue with MP3's.

  • Problems with Whatsapp and the iOS 8.1.2

    Hi
    I have had many problems using whatsapp with my iPhone since I update the iPhone iOS to 8.1.2.
    Whatsapp gets locked frequently and I have to erase it and download again, loosing the last conversations.
    What is happening? What could I do?
    Thanks
    Jorge

    Check with Whatsapp support. If you have downloaded a new one and it is still acting up, there could be something wrong with it and their support should be able to answer your question. That is not an Apple application.

  • Having problems with InDesign6 and the new OSX Mavericks

    I just downloaded the new OSX and now my Id6 won't open. It starts initializing and the I get the message "InDesign quit unexpectedly." I am in the middle of publishing a book for someone using the "export to kindle" plug-in which isn't compatible with IdCC. Has anyone else had this problem?

    I have just run into the same issue. New Macbook Pro running Maverick and I have Vectorworks 2011. Appple support recommends against partitioning the hard drive on a new MacBook Pro running Maverick. (The first call the apple person suggested it. On a follow up call they strongly recommend against doing it because it can screw up the firmware.) How did doing the downgrade work for you, and how did you do it, external drive, partition? I hate to drop $1300 on Vectorworks when I don't yet need it.

  • Problems with VISA and the serial port

    Hello,
    i have a little problem with the serial port and VISA. I have changed an existing LabView- Software in that way that I have replaced the serial- module by the VISA- module. The function of the program is to communicate with different devices by RS232. After changing the modules to VISA the software doesn't work probably. The problem is, that when I try to communicate with one of the devices first I get no answer. When I try it a second time after some seconds the communication works perfect. After about a minute I send another message to my device but there is no answer again. I have to send the message again.
    I hope someone in this forum can help me with my problem
    cu Marco

    Marco,
    this sounds very much like a problem with the termination of your messages. You may have to tell VISA to add a termination character. Please follow the instructions in this document.
    Best regards,
    Jochen
    National Instruments Germany

  • Problems with links and the "advanced" field

    Has anyone else had problems with the advanced field when
    making a new link? It seems I have to edit it three or four times
    before it will actually take the link I put in ("
    http://www.blah.com/" instead of
    "../../"). Anyone else?

    I am having the same problem... although I am only trying to link between "One of My Pages" i.e navigation menus.
    It is pretty random which links work and which don't as far as I can tell anyway.
    The links work fine when I activate hyperlinks in iWeb but as soon as I publish to a folder some of them don't.
    I will post if I find a solution, but I have read and tried just about everything.
    Best
    PowerBook G4   Mac OS X (10.4.9)   1.25 GB RAM

  • Problem with subtotal, and the total icon is not displayed at the toolbar

    Hi all,
    I'm currentlyhaving difficulties working with the subtotal and the grandtotal. I have the code in the right place like the sort table
      CLEAR k_sort.
      ADD 1 TO k_sort-spos.
      k_sort-fieldname = pv_fieldname.
      k_sort-up        = c_x.
      k_sort-subtot    = pv_subtot.
      APPEND k_sort TO i_sort.
    and the fieldcatalog
      CLEAR k_fieldcat.
      add 1 to k_fieldcat-col_pos.
      k_fieldcat-fieldname  = pv_fieldname.
      k_fieldcat-tabname    = c_tabname.
      k_fieldcat-seltext_l  = pv_seltext.
      k_fieldcat-outputlen  = pv_outputlen.
      k_fieldcat-datatype   = pv_datatype.
      k_fieldcat-do_sum     = pv_dosum.
      APPEND k_fieldcat TO i_fieldcat.
    but it didn't seems to show both the total and subtotal. Even the icon is not displayed at the ALV toolbar. The field which I need the total is a currency field. I even try other fields (interger fields) but with no luck. I'm using REUSE_ALV. Any help is greatly appreciated.

    hi,
    In field catalog for the particular column which you want to sum make that as 'X'.
    say
    WHEN'MATNR'.
    it_fcat-do_sum = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program     = report_id
                i_grid_title           = ws_title
    *            i_callback_top_of_page = 'TOP-OF-PAGE'
                is_layout              = wa_layout
                it_fieldcat            = i_fieldcat[]
                it_sort                = i_sortcat
                i_save                 = 'A'
                it_events              = i_events
           TABLES
                t_outtab               = i_reportdata1
           EXCEPTIONS
                program_error          = 1
                OTHERS                 = 2.
      IF sy-subrc <> 0.
    This will enable.

  • After having installed Mavericks I have problems with PSCS5 and the RAW converter. The glider for Exposure goes back to zero, when I use the fill in glider.

    When I use PSCS5 after having upgraded to Mavericks I have problems when I use the RAW converter. The glider for  exposure goes back to sero, hven I use the glider for fill in light, that means that my PSCS5 program not can be used. What do I do?

    Single click on the Home button. Then double click on the Home button. In the recently used row, touch and hold the Contact app till they start to wiggle and then tap the minus sing by the contacts app.
    Also make sure the Contact program on your computer is closed.

  • Problems with ADE and the Nook

    I've encountered an interesting issue with the ADE and the Nook.  ADE dumps the titles in the root directory, which the Nook is unable to see.  I have to manually move the "Digital Editions" folder as a subfolder into the Nook's "my documents" folder.  It's more of an annoyance than anything else, but is there a workaround so that when one drags and drops the book title, it is copied into the right directory?

    Only if you can find the book!!!!!  ADE has 300+ of my books.....too bad I can't even get the from any library on ADE.

  • Problems with updates and the App

    Hi all
    I'm new to the Creative Cloud, and while I'm enjoying all it has to offer I am having some problems. Every time I use the app to update any software, I can't 'update all' I have to update one, quit the app and then re-launch it to run the next software update. As you can imagine this is frustrating and time consuming.
    Has anyone else had this problem, or is a common issue? Any advice or a point in the right direction would be welcome. I've done searches but havn't found what I'm looking for.
    Many thanks.
    Neil

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    The title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen. Click the Clear Display icon in the toolbar. Then take one of the actions that you're having trouble with. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Problems with sync and the music player

    Ok, here we go. my problems started when I bought a mac (I used to have a pc) I transfered all my music and apps to my new mac then... when I tried to sync with my Iphone 4s all my contacts were erased! D: but i think that was because the new computer didnt have a thing, well... thats not the deal, the thing is im not sure if the iphone is recognizing this new computer as the one hehe, the main, so it can save the backup and all that stuff. I have already autorized this mac, and I have checked the option to sync information, music, videos, and photos. After all of that I sync the music and see what happened!  it happened to all of the abecedary, I have already turn the device off, sync again and nothing.  someone can help me please?

    Please someone help me

  • Problems with Ram and the UT2004 Engine

    Hi,
    Got four sticks of 512 MB Geil Value Dual Channel Ram and have filled all four slots on my new MSI K8N Neo 2 board.
    Now everytime I play a game on the UT2003/4 engine (Ravenshield, Republic Commando) the machine locks and freezes making clicking noises. 
    If I drop back to a gig no problem
    Every other game I have tried HL2, Doom 3 etc no probs.
    Has anyone experienced anything similar. It does sound like a game engine problem but I`m open to suggestions to get it running in these game with the full 2 gig enabled.    
    Full System Spec
    Amd 3200+ Wincherster core.
    K8N Neo 2
    2 Gig of Geil Ram
    Asus X800XT PE
    Win XP SP2
    Barracuda 7200.8 Hard Drive
    Sound Blaster Audigy 2 Platinum.

    You should start by increasing the RAM voltage slightly to see if that helps at all.
    Changing the AGP apature size could also matter.

  • Problems with XleTView and the background image

    Hello!
    I�m a student trying to develop aplications with MHP, i am actually using XleTView 0.3.6.
    I�ve traying to show a background image but but nothing appears in the background. I have tryed with Steven Morris's HaviExample and with other codes found in the internet and in this forum.
    As i have read, with this version of Xletview its not neccesary to have an I-Frame so i�ve been trying with .jpg, .png, .gif...
    actually if i try with an .mpg this appears:
    [XleTView]-INFO->org.havi.ui.HBackgroundDevice:
    At the moment XleTView always return a HStillImageBackgroundConfiguration here
    [XleTView]-INFO->org.havi.ui.HBackgroundImage:Display of .mpg is not yet supported.
    A workaround for now is to use a .jpg with the same name.
    xjava.io.File - Menu1.jpg
    and i have the Menu1.jpg in the right directory, but nothig appears. I've tryed the 0.3.5 too. Someone can help me?
    Thank you!!

    Finally i have resolve the problem, i have used this code to resize the video layer (maybe is usefull for someone):
    ServiceContext serviceContext = null;
            Player player = null;
            try{
                 serviceContext = ServiceContextFactory.getInstance().getServiceContext(context);
            } catch(ServiceContextException ex){
                 ex.printStackTrace();
            ServiceContentHandler[] handlers = serviceContext.getServiceContentHandlers();
            for(int i = 0; i < handlers.length; i++){
                 if(handlers[i] instanceof Player)
                     player = (Player)handlers;
    AWTVideoSizeControl awtVideoSizeControl;
    if (player != null) {
    awtVideoSizeControl = (AWTVideoSizeControl) player.getControl("javax.tv.media.AWTVideoSizeControl");
    awtVideoSizeControl.setSize(new AWTVideoSize(new Rectangle(0, 0, 720, 576), new Rectangle(0,0,0,0))); 

Maybe you are looking for

  • Voicemail icon wont go away

    Hi, guys.  This is my first post, although I have been lurking a while.  You guys are full of solutions!  Hopefully, you can solve mine   my BB 8350i has a voicemail icon on it.  I have no voicemails at all, and I want it gone.  I am weird about stuf

  • Pse10 folder view--- display reset to top folder (user acct) when opening a closed folder

    when in folder display, whenever i open a folder that is closed, the folder display goes back to the top of the list and I have to scroll down to the location of the just opened folder to see it again.  This only happens in pse10, i have pse8 on anot

  • Unable to access apex console

    Hello guys, Database: Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Beta Apex: Application Express 4.1.0.00.29 I was able to login to the development console without any problem. But now 1. When I try to access a workspace with the c

  • BB Bold - Desktop not recognizing my device

    I have not had this problem previously. It just started today. I don't believe that I chanegd any settings, but now my Desktop Manager does not connect to my device. Phone shows charging, so the USB is working. Any help out there?

  • Install CS5 extended

    Hello All, Just bought CS5 extended upgrade yesterday,  don't have the software yet and I've a question about the installation: Do I need to deactivate CS4 Extended then uninstall and then Install CS5 extended ? TIA