Extract multiple text column regexp matches

Hello

I am extracting a column of text (VARCHAR2) purchase order codes in an Oracle (11g R2) database that contains descriptions of invoice handwritten by accountants.

Purchase order code has this fixed structure of 10 characters:

-first two letters, the code of City USA

-third and fourth letters, always WE

-cinquieme to the tenth, six numbers.

Data samples:

'NYUS746082 '.

"P.O. wcus216540.

"Maintenance of network CHUS412795 - CHUS412796 02/07/2012"

"LAUS213789, DTUS556210, BSUS723005 contract security guards.

I use this query that extracts the first command and warned me that if the codes found are > 1:

SELECT REGEXP_SUBSTR (UPPER (INVOICE_DESCRIPTION), '(BS|)) CH | DT | THE | NEW YORK | (US\d WC) {6}') AS PO_NUMBER,.

REGEXP_COUNT (UPPER (INVOICE_DESCRIPTION), '(BS|)) CH | DT | THE | NEW YORK | (US\d WC) {6}') AS PO_COUNT

Of

(SELECT "Limousine rental 2014 (WCUS213789)" AS INVOICE_DESCRIPTION)

OF THE DOUBLE

);

Is it possible to extract all the matches in the same column?

I found a few examples that values separated by commas of split, but in my case, the separator is not predictable.

Thanks a lot for your time,.

Marco.

Select this check box.

SELECT REGEXP_SUBSTR (UPPER (STR), +'([[:alpha:]]{2}US[[:digit:]]{6}) ', 1, LEVEL) IN T1

CONNECT BY LEVEL<>

AND PRIOR STR = STR

AND SYS_GUID() PRECONDITION IS NOT NULL;

For the sample data.

WITH T1 (STR) AS (SELECT 'NYUS746082' FROM DUAL UNION ALL

SELECT 'Po wcus216540' DOUBLE UNION ALL

SELECT "maintenance of the network of CHUS412795 - CHUS412796 02/07/2012"IN the DUAL UNION ALL

SELECT "LAUS213789, DTUS556210, BSUS723005 contract security guards" of THE DOUBLE)

SELECT REGEXP_SUBSTR (UPPER (STR), +'([[:alpha:]]{2}US[[:digit:]]{6}) ', 1, LEVEL) IN T1

CONNECT BY LEVEL<>

AND PRIOR STR = STR

AND SYS_GUID() PRECONDITION IS NOT NULL;

OUTPUT:

CHUS412795

CHUS412796

NYUS746082

WCUS216540

LAUS213789

DTUS556210

BSUS723005

Tags: Database

Similar Questions

  • Delete multiple text Messages?

    Search here and elsewhere but do not find an answer to my question. On previous Motorola phones, I could delete multiple text messages in just long-pressing the specific text message in a thread... then tapping each additional I wanted to delete... and then selecting delete. This way I could whittle down some long threads.

    However, since I got my Verizon Moto X, it seems that the only way to remove any message text is either one-at-a-time, or all of the text don't thread at once... no more the ability to choose several text messages in a thread to delete several at once? I forgot something, or a simple feature common sense has been removed?

    My question is not focus on deleting a thread complete or using the default value for a maximum number of messages to be automatically deleted (i.e. the maximum of 500). Its more specific to trimming/weeding out text messages in a thread in the messaging app.


  • Problem of matrix report with model RTF - text columns

    I have problem with matrix necessary report...

    I did it before using the pivot function in rtf export then the stylesheet xsl fo... model

    My problem here is in this case, the desired column (value - the center column) is the text column, and the pivot is based on the aggregate (sum or count) function that I don't want in my case.

    Attached my XML, and sample to in the excel sheet...

    and to understand the business, it's for quality module in EBS... The user can take 3 samples in the same sample for the same item, I want to show the name of tests alongside its results grouped by the number of the sample.

    any help would be much appreciated...

    This can be achieved through custom PivotTable.

    I created the RTF template for your condition.

    PFA (model and output)

  • ORA-02256: number of referencing columns must match the referenced column

    The following script produces

    ORA-02256: number of referencing columns must match the referenced columns, can't think of any reason, someone has an idea?

    Please help, I am stuck on an assignment...!

    Capture.PNG

    drop table qualitycheck;

    drop table distribution;

    Manager to move table;

    CREATE THE TABLE MANAGER)

    MgrID number (4),

    mfirstname varchar2 (30),

    msurname varchar2 (30),

    Primary key (mgrid)

    );

    CREATE DISTRIBUTION TABLE)

    ProdID number (4) CONSTRAINT NN_PRODUCT_prodid NOT NULL,

    MgrID number (4) CONSTRAINT NN_MANAGER_mgrid NOT NULL,

    Primary key (prodid, mgrid)

    CONSTRAINT FK_ALLOCATION_MANAGER_mgrid Foreign Key (mgrid) REFERENCE MANAGER,

    CONSTRAINT FK_ALLOCATION_PRODUCT_prodid Foreign Key (prodid) REFERENCES PRODUCED

    );

    CREATE TABLE QUALITYCHECK)

    ProdID number (4) CONSTRAINT NN_ALLOCATION_prodid NOT NULL,

    MgrID number (4) CONSTRAINT NN_ALLOCATION_mgrid NOT NULL,

    number of weekno (2),

    Partition number (1),

    Primary key (prodid, mgrid, weekno)

    CONSTRAINT FK_QUALITYCHECK_PRODUCT_prodid Foreign Key (prodid) ATTRIBUTION of REFERENCES,

    CONSTRAINT FK_QUALITYCHECK_MANAGER_mgrid Foreign Key (mgrid) ASSIGNMENT of REFERENCES

    );

    Hello

    Reason is the primary key of the table that is assigned prodid, mgrid, but you try to create the foreign key columns separately.

    Try which follows and this should work:

    CREATE TABLE QUALITYCHECK (
      prodid number (4) CONSTRAINT NN_ALLOCATION_prodid NOT NULL,
      mgrid number (4) CONSTRAINT NN_ALLOCATION_mgrid NOT NULL,
      weekno number (2),
      score number (1),
    
    Primary Key (prodid,mgrid,weekno),
    
    CONSTRAINT FK_QUALITYCHECK_PRODUCT_FK Foreign Key (prodid, mgrid) REFERENCES ALLOCATION
    );
    
  • Copy of Acrobat Reader text columns

    I know that you can use the ALT key while selecting a text box with the mouse and therefore manually copy and paste the player text columns in separate columns of text in Excel, but it's quite tedious.

    Highlighting a section in an entire page that is displayed as columns and then paste into Excel will most likely result a single column with all the text in a line in a single cell. Text of the columns is separated by a space instead of a tab or a coma.

    Player is clearly able to format text in columns on the screen so that the information must be stored in the file so that it can interpret the provision in such a manner.

    Then why can't I copy that it's on the screen and paste into several columns of text in Excel?

    I did several searches on this and have not met anyway to do this using the player.

    There is no such thing as spaces or "column breaks" in the PDF files. Each word, each character, you see is placed on the page regardless of everything above. When you export to Excel (or any other format) attempts of application of "guess" what the file structure should be and convert it into a usable format, but it does not always succeed because it is an extremely complex operation and there are a lot of factors involved.

    For example, the spacing between the columns in the screenshot above is not the same. Whose to say that the text in the second column is not actually part of the third, because they are very close to one another? To the human eye, it's easy to see that they are separated because there is a line between them and because the second column contains numbers and the third argument contains text, but for a computer algorithm which is a very difficult decision to come to.

  • Cut the text column's timestamp hh

    Hi all

    I'm cutting the text column's timestamp hh: 2014-02-18 08:39:56

    I tried the format of data as hh: mm, but it does not work as she filed is defined as text and also Cast (Cast (as float) as timestamp) / cast (as a timestamp) did not work.

    many will appreciate any advice on how to solve this problem!

    Hello

    It is a new feature available in 11g...

    Column properties Goto--> column properties--> format of data--> custom--> hh: mm

    This will display the format hh: mm in the timestamp format.

    Thank you

    prassu

  • can I add a multiple text fields in a label?

    Can I add a multiple text fields in a label?

    If you use the FormsCentral Designer, you can add less than with the tag additional text fields and give them all the labels.

    About the future of the forms with Acrobat, you always have the possibility of creation of the presentation of the form in InDesign, Word, etc., by generating a PDF file and adding the fields. This is how it was done since the forms were introduced with Acrobat 3. If you have 11 Acrobat is installed, you can continue to use the application designer FormsCentral.

  • Extraction of text from an existing site...

    I need to recreate a customer site but can really do without cut and paste... any suggestions?

    Even 3rd-party solutions welcome


    Thank you


    Garth

    Hello

    Try the Web site, TextEVO - Extraction of text / Image Manipulation and navigation

    On the file menu, click "Retrieve the text of the Web site", and then enter the URL of the Web page and it will bring you the text

    Let me know if you are looking for something else, or if I missed something.

  • Multiple text entry boxes

    Can I get help with text input boxes?  I have a slide where I want the student to enter some multiples of two numbers.  On my blade, I put five text entry boxes.  I wonder what values are correct for the boxes, and I put 8,12,24,12,18, respectively.  I don't know how to proceed after that.  Can I put a single button "Enter" so that the answers will be verified?  If the answers are false, he will tell the student who are wrong?

    Use the variables created by the user for responses - such as v_8, v_12, v_24, v_8, v_18?

    Using variables created by the user allow me to activate Advanced Actions, depending on whether the answers are good or bad and bring them to the next slide in the series if they are correct, or have them redo this slide or to examine multiple if they are incorrect?

    I just want to understand how it goes together.  Thank you.

    c1.png

    Indeed, the value that was inserted in the TEB will be displayed, even if you clear the value of the associated variable. You need a widget for this.

    It is not possible to explain the workflow in a forum, sorry.

    Aggregation of the BER results of in Captivate - Captivate blog

    A submit button for multiple text entry boxes? -Captivate Blog

    Maybe these posts can help a bit.

    Lilybiri

  • Extraction of texts of paragraph with RangeStyle

    Hello!

    I need help, extraction of text of paragraph peacekeeping style applied directly on the characters without going over all the characters.
    Prerequisite - bypassing the need is paragraps.
    For example: "a string representation of a value of FontFamily, possibly including values of relief or index in a font file, or a URI where the font family is thrilled. .
    " For more information on the syntax, see Fontfamily."

    In the myParagraph.TextStyleRanges (1). Texts (1) stored text with style "color = blue", and the content is really only part of the FIRST paragraph.

    In the myParagraph.TextStyleRanges (2). Texts (1) stored text with style same "" BOLD"= true", but in mixed text, first and second paragraph simultaneously stored content.

    RangeIndex = 1 to _story. TextStyleRanges.Count

    Var InDesign.TextStyleRange As mRange = _story. TextStyleRanges (rangeIndex)

    rStart = mRange.Characters (1). InsertionPoints (1) .index

    RIP = mRange.Characters(-1). InsertionPoints (1) .index

    ParagraphIndex = 1 to mRange.Paragraphs.Count

    Dim mParagraph As InDesign.Paragraph = mRange.Paragraphs (paragraphIndex)

    If mParagraph.ParentTextFrames.count > 0 Then

    pStart = mParagraph.Characters (1). InsertionPoints (1) .index

    pEnd = mParagraph.Characters(-1). InsertionPoints (1) .index

    If pStart > = rStart can

    If IsNothing (mTag) = false then

    "new paragraph".

    End If

    Var _max = Math.Max (rStart, pStart)

    Var _min = Math.Min (RIP, hangs)

    pText = (_XMLCorrect (Mid (mRange.Texts (1) .silence, _max - rStart + 1, _min - _max + 1)))

    "StyledText, bold or underline or italic of mRange.

    End If

    Next

    Next

  • Change the margins... How update text blocks to match?

    Hello

    I have a 80-something-odd-page document, I needed to change the margins on. No problem. Now, however, I want to update the 80-something-odd text frames to match the new margins. No, I was not choosing "Master-text block" when I created the document, because I am new to the program and I am usually not smart.

    Is there a way to do this?

    Alternatively, if I now create a new document (with master selected text block), I can "place" the old document in there?

    Thank you very much! Someone out there, you'll earn my cyber-praise with a response.

    There is no need of a block of text type.

    If you all of your blocks of text created by hand, but made sure to exactly match the lil purply indicators 'margins', all you have to do is enable layout adjustment, in the menu available. Then change your margins - you will see that your text frames will follow. (Toot suite too, as say the French!)

  • Kerning in a left-aligned text column

    How do you get the text to go to the right-hand side of a text column when you have a left-aligned paragraph? When I adjust the tracking/kerning there seems to be a right auto dash that I can't work on the deletion of about 5mm.

    Image attached, shows what I mean... I want the first line to go further in all, but he's not going past the guide I put in place.

    Picture 1.png

    Two possibilities: either you have "Lines balancing ragged" enabled (which will try to make each line the same length), or it is caused by the paragraph composer (which attempts to balance the amount of white space at the end of each line).

    Solution # 1: clear the balance of the jagged lines.

    Solution # 2: use the single line composer - who will fill each row until the scope before continuing with the next and the right side will not be as well inconsistent as it is now.

  • How can I change the size of the text column universally?

    I have created a book of a customer to ID CS4. The client decided that he would like a more narrow column of text throughout the book. (Each chapter of the book is its own file). I thought that this could be accomplished by going on the master pages, change margins and reapply the master pages, but it does not work. It does not change the text column, but the image containing the text does not change with it. Except changing the image manually, is there a way to change the existing dimensions of text column universally in a chapter? (I hope I'm being clear on what I'm asking.)

    This would have worked "as what" If the executives were on master pages, I think, but always possible even without master frames if executives adjustment the margins of the page. The secret is 'layout adjustment' which must be turned on before making changes in the margin.

    Go to the Layout > setting layout... and turn on, then make your changes on the master page. No doubt, you're ready for oversets that the adjustment of the width of the frame is likely to cause.

    Peter

  • Choose between MySQL and Oracle - problem with MySQL text columns?

    Hello.

    New to this forum and Oracle please go easy on me.

    I'm selecting data in a MySQL database.

    This SQL works very well: -.
    Select 'Device_Label' Device"@ed_link «»
    where "Device_ID" = 6665;
    Here, the MySQL Device_Label column is of type varchar (255).

    This SQL fails with the error - ORA-00904: "Device_Tag": invalid identifier
    Select 'Device_Tag' Device"@ed_link «»
    where "Device_ID" = 6665;
    Here, the MySQL Device_Tag column is of type text.
    Column Device_Tag certainly exists and is populated.

    Is the problem related to the MySQL type text column, and is there a solution?

    Thank you.

    Hello
    The ora-997 because of the entry door is not a restriction of the Oracle. You cannot use a table defined as a long in the create table... as select statement..., you would see the problem even if it was a copy of Oracle for Oracle.
    If one of the columns of MySQL are translated as a long in Oracle you will hit this problem.
    The bypass alone is to avoid columns long or you can try to create a view in MySQL by using the cast function, which converts the columns that translate to long something and then use it in the create statement.

    Kind regards
    Mike

  • Another REGEXP question: how to extract multiple values from a string

    Hi, how can I retrieve multiple values to a string with RegExp with Oracle SQL constructs?

    Have looked at the various examples, I cannot understand this.
    the following Sql code
    select
       regexp_substr(sessie."rollen", 'CN=A_role') "A_role"
       from ( 
    select '
    CN=A_role,OU=a_org_unit,OU=another_org_unit,DC=bz,DC=ad,DC=min,DC=local
    CN=Another_role,OU=some_org_unit,DC=bz,DC=ad,DC=min,DC=local
    CN=Users,OU=Dep,DC=bz,DC=ad,DC=min,DC=local
    '   "rollen" from dual
    ) sessie;
    Returns CN = A_role.
    I want him back all of the CN = concatenated values with a semicolon and stripped of the CN = bit.
    So: A_role; Another_role; Users .

    Any help would be much appreciated. Here I use database 11g 11.2.0.2.0.

    Does anyone have an idea how to do this in SQL?

    best regards Mike

    Hello
    If using Oracle 11 g

    with tst
      as (select   'CN=A_role,OU=a_org_unit,OU=another_org_unit,DC=bz,DC=ad,DC=min,DC=local,'
                 ||'CN=Another_role,OU=some_org_unit,DC=bz,DC=ad,DC=min,DC=local,'
                 ||'CN=Users,OU=Dep,DC=bz,DC=ad,DC=min,DC=local' as rollen
            from dual
          )
    select listagg(sub, ',') within group (order by rn) as res
      from (select regexp_substr(rollen, '(CN=)([[:alnum:]_]+)',1,rownum,'i',2) sub, rownum rn
              from tst
           connect by level <=length(rollen)
           )
     where sub is not null       
    

Maybe you are looking for