regexp_substr and select all the

Hello

I have this doubt, I have a query like this:

SELECT *.
TABLE
WHERE DIVISION)
SELECT REGEXP_SUBSTR (DIVISIONS, "[^,] +', 1, LEVEL") OF THE DOUBLE
CONNECT REGEXP_SUBSTR (DIVISIONS, "[^,] +', 1, LEVEL") IS NOT NULL)
;

It works fine when DIVISIONS his as "3,4,5,6.
but I want, when DIVISION sound empty ("") it does not, filter

Can you help me to find out how I can do this?

Thank you

What:

SQL> var divisions varchar2(100)
SQL> exec :divisions := '3,2,6,7,8,6,34'

PL/SQL procedure successfully completed.

SQL> -- generating sample data:
SQL> with t as (
  2  select 1 div from dual union
  3  select 2 div from dual union
  4  select 3 div from dual union
  5  select 4 div from dual union
  6  select 5 div from dual union
  7  select 6 div from dual
  8  )
  9  --
 10  -- actual query
 11  --
 12  select *
 13  from   t
 14  where
 15    case
 16      when :divisions is null then 1
 17      when :divisions is not null
 18      and div in ( select regexp_substr(:divisions ,'[^,]+', 1, level)
 19                   from   dual
 20                   connect by regexp_substr(:divisions , '[^,]+', 1, level) is not null
 21                  ) then 1
 22    end = 1;

       DIV
----------
         2
         3
         6

3 rows selected.

SQL>  exec :divisions := '';

PL/SQL procedure successfully completed.

SQL> -- generating sample data:
SQL> with t as (
  2  select 1 div from dual union
  3  select 2 div from dual union
  4  select 3 div from dual union
  5  select 4 div from dual union
  6  select 5 div from dual union
  7  select 6 div from dual
  8  )
  9  --
 10  -- actual query
 11  --
 12  select *
 13  from   t
 14  where
 15    case
 16      when :divisions is null then 1
 17      when :divisions is not null
 18      and div in ( select regexp_substr(:divisions ,'[^,]+', 1, level)
 19                   from   dual
 20                   connect by regexp_substr(:divisions , '[^,]+', 1, level) is not null
 21                  ) then 1
 22    end = 1;

       DIV
----------
         1
         2
         3
         4
         5
         6

6 rows selected.

Tags: Database

Similar Questions

  • How it is possible to create the chekbox in interactive report column header and select all the features.

    Hello

    My requirement is

    Interactive report the first element of box check columns and the topic also point check box.

    If I click on the element of box section columns and then automatically select all the lines in the box.

    Select all / deselect all interactive report header check box.

    Kind regards

    Arianne.

    Check this box

    https://Apex.Oracle.com/pls/Apex/f?p=76604:2:111027941779152:

    username:-test

    password:-test

    SELECT

    APEX_ITEM. HIDDEN (2, null, null, 'f02_': rownum) |

    APEX_ITEM. CHECKBOX2 (P_IDX-ONLINE 01,

    P_VALUE-online null,

    P_ATTRIBUTES-online null,

    P_CHECKED_VALUES => NULL,

    P_CHECKED_VALUES_DELIMITER => ':',

    P_ITEM_ID-online 'f01_ ' | ROWNUM,

    P_ITEM_LABEL => ' label for f01_ #ROWNUM # ')

    as Delete1,.

    of the double

    Choose the column type: report

    in the heading of column delete1

    Simply put

  • How to select all the text, all layers including locked or not visible, using VBScript?

    I'm looking for the more elegant syntax through a document and select all the text frames.

    You cannot select objects in... locked or hidden layers, so you will need to unlock/show layer and do what you need to do with the text, while the layer is visible/unlocked.

    to get all the loop text through the text in the object of the document, you will get all the text elements. If you loop through text in a layer object, you won't get the text located within groups.

  • In photoshop CS5 (bridge) I could select all the images and their size still before turning them into JPEG files. I can't find a way to do it in CC

    In photoshop CS5 (bridge) I could select all the images and their size still before turning them into JPEG files. I can't find a way to do it in CC

    Hi Tanuj.

    I actually understand it. Not the best user friendly system. Where as before (CS5), I just had to go to crop tool and choose the dimensions and the inches now it in the window. Just really complicated for nothing.

    Thanks anyway Tanuj

    Melanie

  • I need to select all the blocks of text in a document and align text blocks in the back pages left frame margin and the text in the pages front to the right margin.

    Hello

    Am new to Java script.

    Can someone help me out here, I need to select all the blocks of text in a document and align text blocks in the pages back to the left margin frames and text in pages recto at the right margin.

    Thank you
    Harish

    Hi Harish,

    Try this.

    var doc =app.activeDocument,
        _pages = doc.pages;
    doc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
    for(var i =0;i<_pages.length;i++)
    {
            txfms = _pages[i].textFrames.everyItem().getElements();
            for(var j =0;j
    

    Kind regards

    Cognet

  • Must select and change all the type is defined in a specific font

    I'm working on my memory of brother-in-laws on the biology of the molecalar. It is very important in these types of documents, get all the names of some species and protein italicized. Unfortunately it manually set all those names in italics, instead of the use of character styles.

    I need some way to be able to select any italicized and assign a character style. Because the way in which this document of his is at least 140 pages A4 and the subject matter is way, way, way over my head, I need a way to automate the process.

    Y at - it a function or perhaps a script that automatically detects the type in a specific font and gives the possibility to assign a character style?

    Thank you

    I wrote a script to do exactly that - and replace all the exhibitors, indices, bold, bold italic, and a bunch more, with their Style of character equivalent. The script creates even all styles, that he needs.

    Download from http://www.jongware.com/binaries/preptext.zip - additional instructions and tips found in this same forum (search for "preptext").

  • 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.

  • How to extract the same song, several times using different bit rates or formats and store all the digital music files in WMP 12 default on the same HDD music library

    Using Windows Media Player 12 (w/under Windows 7), "can I ripping the same song, several times, using different bitrates & and/or formats and store all the digital music files in the music library by default WMP - 12, on the same hard drive?

    1.) #1 goal: tear up the same song repeatedly, w / "different rates" as a WMA file.

    2.) #2 goal: tear up the same song repeatedly, w / "different rates" as an mp3 file.

    3.) #3 objective: NOT to each subsequent copy (version) of the song, deleted & and/or replaced by the previous version of the song [even].

    4.) question Bottom Line Up Front--> is Windows Media Player 12 (included with the Windows 7 operating system) are able to achieve '#1 objectives; #2; & #3 above?

    5.) details/example: I want to tear the piece "Maria Maria by Carlos Santana" to my laptop as a Windows Media Audio [WMA] file.  In addition, I would like to rip the song 'Maria Maria' three several times with 3 different bitrates in format WMA; and, as an MP3 file.  Therefore, my final result wished (after the extraction process), will take place the four 4 audio files split up as follows: (a) 'Maria Maria by Carlos Santana'--> Format: file WMA; Ripped @128 Kbps bitrate.  (b) ' Maria Maria by Carlos Santana'--> Format: file WMA; Ripped to the "Variable bit rate; (c) ' Maria Maria by Carlos Santana'--> Format: file WMA; Ripped commissioning "Lossless." and (d). 'Maria Maria by Carlos Santana'--> Format: MP3 file. Ripped @256 Kbps bitrate.

    6.) my preference: I do NOT want to rename the file (s). {for example, 'Maria Maria by Carlos Santana' renamed/changed for--> "Maria_Maria_by_Carlos_Santana_128kbps.wma",...} 'Maria_Maria_by_Carlos_Santana_256kbps.mp3 '; etc.}.  In addition, I am not concerned about the additional disk space that will be consumed after multiple copies of the same song with different speeds of transmission and different formats.

    7.) my experience w / Windows Media Player 10 (w / the operating system of Windows XP): using WMP - 10, my goal (s) described above is not a problem at all.  Simply insert the CD purchased by Carlos Santana, containing the song "Maria Maria"... Select the desired Format (WMA; WMA VBR; WMA Lossless; or mp3)... Select the desired flow rate (WMA... 128/160/192kbps_mp3: 128/192/256/320 kbit / s; etc.) ; and click on the "RIP" button to start the copy process on the hard disk of of Carlos Santana's "Maria Maria".  This process (w / WMP-10) would result in having the same song, copied on the hard disk, with levels of quality different "audio" (via the different bit rate settings); regardless of the format (MP3/WMA) which was chosen.

    8.) my experience w / Windows Media Player 11 (w / the operating system of Windows XP): using WMP 11, to described above of my objective (s) could not be reached e-a-s-i-l-y.  The problem with WMP - 11 - in short - which was after the desired selection "Rip settings" tab 'Options' of WMP - 11 (i.e., Format & Bit Rate) and heart-wrenching piece wanted to {'Maria Maria by Carlos Santana'} a moment later/second, WMP11 remove / would crush the previous version of the song [even].  Therefore, the program would NOT allow the user to have multiple copies of the same song on the hard drive of the PC; which obviously restricts a user to have the freedom to choose what level of quality digital audio, they prefer to listen to.

    9.) the ability to have multiple copies [at my descretion] of the same song (on my hard drive) with different bitrates and formats in my music library, is important for me because it has a direct impact on "how I enjoy MY music ', and in what form (audio quality), I choose to listen to my music.  {For example, when I exercise and listening to my camera, digital audio player (Zune), a song ('Maria Maria by Carlos Santana'), will usually be torn off at a lower rate due to the unit of capacity reduction of storage - compared to the storage capacity of notebook PCs/desktop/external hard drives PC.}  However, when I listen to my music through my home cinema or entertainment system (which contains a hard disk dedicated with a large storage capacity), I prefer to load the entertainment system with digital music files that have been ripped to WMA... with the bit being rate-setting is for the: settings "WMA Variable Bit Rate" or "WMA Lossless.

    10.) there you have it.  This is my first post in this forum.  I hope that [detailed] explanations, will be sufficient to encourage these "with knowledge & the hands on experience" using Windows Media Player 12 (as well as with WMP-10/WMP-11 respectively), by providing a [step] "How-to"... "solution to my situation.  It would be highly appreciated.  I'm looking forward-'the solution' - and relevant suggestions & and/or community feedback regarding my request for assistance.

    * Thank 'All' (that would) in advance... For your time & Assistance *.

    Certainly, you can, but I would say that they be in different folders, for your convenience as well as Windows.  You can create one for each debit/format, then you will know who is who.

    In Windows Media Player, on the toolbar, select Tools, Options, Rip, and then select the flow you want first, rip music, then change the folder (higher on the same tab) and rip again... and so on and so forth.

    When you are at home on your home theater, you can use the 320 bitrate folder, when you transfer to the Zune, you can use one of the lower bitrate files (although I personally tear it up to 320 and let the Zune reduce as he wants, even with the iPhone via iTunes, hard drive space is not really a problem here) my server has several hard drives, and I can always add more if and when space is low!

  • BlackBerry Z10 how bulk delete email - not 5 or 10 by selecting all the emails one by one, but 'delete before... '. "or similar

    Hi Cimmunaute

    as you often work and as you say you have a lot of emails: how to remove the masses as delete block? on my old blackberry (except z10 newstes) I had the option "remove all front of (...)". Date"in the context menu, and could remove 1500 emails with a tap. do you know how to do this now? There is not such a function, we have to type and mark each email, even if there are 2000! crazy!

    Thank you very much!!

    BB: Please urgently add functionality...! I have an imap account with approximately 200 emails a day that are just a copy of the mail of the company and need to delete hundreds every day. I can not press on and select all mails only one and then delete.

    Go in the hub, select e-mail account, just under the blue email account, click and hold the date below it, cursor appears on the right, click Recycle Bin (before deletion).

  • How to select all the text with QNX TextInput

    With QNX TextInput, is there a way to select all the text? Spark TextInput a selectAll() method to select all text, but I do not see a similar method in QNX TextInput. No idea how you can choose all the texts with QNX TextInput. Thank you.

    Hey French,.

    Thanks for the clarification! I think I can help you. Here is a code example to show my explanation. In the code below when a user clicks the LabelButton object it will assign the focus to your TextInput object and then select all the text in this object. The only downside is that it will not bring the keyboard. so far, we are not successfully by invoking the keyboard without the user clicking on the TextInput. in any case in the code below, we use TextInput property the textField object as a reference to the TextField object internal. from there, we use the setSelection() method to select the text inside the object from the start to the end position pos. Here's the same code:

    package
    {
        import flash.display.Sprite;
        import flash.display.StageAlign;
        import flash.display.StageScaleMode;
        import flash.events.FocusEvent;
        import flash.events.MouseEvent;
    
        import qnx.ui.buttons.LabelButton;
        import qnx.ui.text.TextInput;
    
        [SWF(width="1024",height="600",backgroundColor="#CCCCCC",frameRate="30")]
        public class TextInputTest extends Sprite
        {
    
            private var myInput:TextInput;
    
            public function TextInputTest()
            {
                super();
    
                // support autoOrients
                stage.align = StageAlign.TOP_LEFT;
                stage.scaleMode = StageScaleMode.NO_SCALE;
    
                myInput = new TextInput();
                myInput.setSize(300,50);
    
                addChild(myInput);          
    
                var newBtn:LabelButton = new LabelButton();
                newBtn.label = "Click Me";
                newBtn.setPosition(325, 0);
    
                newBtn.addEventListener(MouseEvent.CLICK, selectMyText);
    
                addChild(newBtn);
    
            }
            private function selectMyText(e:MouseEvent):void
            {
                stage.focus = myInput;
                myInput.textField.setSelection(0, myInput.textField.length);
            }
        }
    }
    

    hope it's what you want. Good luck!

  • Properties tab shows 3609 files, when you select all the files it only shows the files in 1974?

    When I right click and select Properties tab it shows 3609 files, when selecting all the files to copy shows only the files of 1974?

    Hello Tony,.

    If it is certainly a big difference, I think that for most all of this is taken up by folders and subfolders which are mainly empty place holders. Have you looked at the folder with Windows Explorer? A freeware application that can help is WizTree, it provides both a performance graphics and text of what's on your hard drive (or part of it). Can be very educational. Download here: http://antibody-software.com/web/software/software/wiztree-finds-the-files-and-folders-using-the-most-disk-space-on-your-hard-drive/ .

    Let me know if this helps you.

    Kind regards

    BearPup

  • Check box in the header of the classic report: select all the report Archives

    Hi friends,

    I use Apex 4.2 worm.

    I've created a classic report and create the check box (apex_item.checkbox (1), EMPNO, 'DISABLED' tick,) in this report.

    My Code

    Select * from)

    Select

    apex_item. CheckBox (1), EMPNO, "DISABLED" tick.

    "EMPNO', 'ENAME', 'JOB', 'MGR', 'HIREDATE',"SAL","COMM","DEPTNO. "

    from EMP)

    where)

    InStr (upper ("ENAME"), upper (nvl (: P6_REPORT_SEARCH, "ENAME"))) > 0 or

    InStr (upper ("JOB"), upper (nvl (: P6_REPORT_SEARCH, "JOB"))) > 0

    ) and

    (nvl(:P6_ENAME,'0') = '0' or ENAME =: P6_ENAME) and

    (nvl(:P6_JOB,'0') = '0' or JOB =: P6_JOB) and

    (nvl(:P6_MANAGER,'0') = '0' or MGR =: P6_MANAGER)

    and

    (nvl(:P6_DEPT_NO,'0') = '0' or DEPTNO =: P6_DEPT_NO)

    I need to create the checkbox in the header of the classic as tabular report where if I click in the header box then all archives should be checked.

    How can I do this with classic report.

    If you want to see this issue in the workspace, then you can use the workspace details below

    Workspace: APEX_ISSUE

    User name: [email protected]

    Password: kaushik1@34

    Page no.: 6

    Thank you

    Hi Maxence,

    The above problem is solved. Please check the same.

    I added the following code in the header of the first column:

    
    

    NOTE: I used Carl Backstrom solution for this: Blog of Carl Backstrom: Mini check all HowTo

    But this solution works only when the first column in your report / table is a checkbox.

    If you have more columns rather than the first column where you want to check and uncheck all the features then follow the solution of Jeff Kemp:

    http://jeffkemponoracle.com/2012/11/15/select-all-Unselect-all-checkbox-in-interactive-report-header/

    I hope this helps!

    Kind regards

    Kiran

  • Select all the script maps

    Hi all

    Hoping someone out there can help, I need my script to end with one of the following 3 options:

    Select all: as in "cmd one"

    Select all the objects on the layer "Tabs".

    Select all the objects with the Script title boxes"tabs".

    Reason being, when the script ends I need a bunch of boxes to be pre-selected loan for a manual deselect by 1 point (chosen by the user) and then they Deletes selected objects manually to finish. (I didn't understand my original script here as has no impact on the autonomous part I need for the final selection)

    Hoping that this is a simple script but as it is rare to have a script of object selection and not do something with them, I think it's impossible to create.

    Thank you, Bren

    Read the object model and you will find that the equivalent script Cmnd + A is as follows:

    app.selection = null;
    pItems = app.windows[0].activeSpread.pageItems;
    app.select (pItems, SelectionOptions.ADD_TO);
    

    To select all items in the layer tab page, filter the items in the page:

    app.selection = null;
    pItems = app.windows[0].activeSpread.pageItems;
    
    for (i = pItems.length-1; i >= 0; i--) {
      if (pItems[i].itemLayer.name === 'Tab') {
        app.select (pItems[i], SelectionOptions.ADD_TO);
      }
    }
    

    To select objects with a certain script label is a variant of the (or an addition to) the second script.

    Peter

  • We just do the last update on Photoshop - that's why whenever we now open photoshop you have to select all the toolbars we want.  They used to be there for example, layers, tools, colors, etc., but now, we have to select each time

    We just do the last update on Photoshop - that's why whenever we now open photoshop you have to select all the toolbars we want.  They used to be there for example, layers, tools, colors, etc., but now, we have to select each time

    You look at the new start screen and files recent screen.  Press ESC to return to your usual workspace.

  • How to select all the text fields at a given time in Adobe Reader ms?

    I created a document that contains more than one text field I created with Acrobat Pro DC, I want to allow the user the ability to select all fields in order to change the text size/color and fonts at the same time... not having to go through the entire form and must make each field separately. To be a little more specific, the document is two pages with six place/lounge cards per page, designed for weddings and other events. Each place card has a field for 'user name' and ' number of table: my question is...» Is it possible to 'select all fields' in Adobe Reader? If I go to Edition > select all, the program selects all graphics and none of the text fields. Not exactly what I'm missing here and I can not find my answer online. Any information would be greatly appreciated.

    Thank you!

    Jodi

    In this case, you can only change the properties of the text selected within a field. Acrobat Reader cannot change the properties of the text field.

Maybe you are looking for

  • Empty message unknown

    I had this happen to me for a few weeks now on my iPhone 6s more 64 G: I'm going to randomly go in the text message app someone or look at my messages and I will see a message "Unknow" without text or anything like that it is empty. I can click on it

  • What can I do if my 6s sillicone iPhone chip?

    I bought my case silicone back in September and noticed a few days ago it was a small tear. The phone has never been dropped. A few days later, I noticed a similar tear at the bottom of the case. These silicone tears fell gradually just leaving small

  • "Buy" button does not not in iTunes

    I tried to buy songs the last 2 days and 2 different albums. If I try to any purchase of simple songs, it does not. I hit the button buy, and it just runs. It should go to "check w / fingerprint" or the password, but it doesn't. It started just after

  • Pavilion dm4t-2100: the password of bios Hp dm4

    I can't get into the bios for my HP. ask the bios password and after 3 attempts to get the error code: 87422946. Thank you.

  • I am trying to activate Office 2007 Home.

    When I try to activate the components, varoius online I get this error message "a communication error has occurred. Unable to process your request at this time. Please try again in a few minutes. "Nothing happens no matter how many times I try all th