Get the 3rd word in a string

I have these sample data:

set linesize 500

with tbl_data AS
(SELECT '1234567 JAMES BOND MI5 Spy 01-MAY-14 31-MAY-14 543.21' str FROM DUAL)
SELECT str
     , REGEXP_SUBSTR(str, '[0-9]+') AS emp_no
     , REGEXP_SUBSTR(str,'\ ([^ ]*)\ ', 1,1,null,1) first_name
  FROM tbl_data;

STR                                                   EMP_NO       FIRST_NAME  
----------------------------------------------------- ------------ ------------
1234567 JAMES BOND MI5 Spy 01-MAY-14 31-MAY-14 543.21 1234567      JAMES       

1 row selected.

I'm stuck trying to get the family name, which in this case would be "LEAP."

Sorry to be thick and lazy.

Thank you

with tbl_data AS (SELECT 1234567 JAMES BOND MI5 Spy may 1, 14 May 31, 14 543,21' FROM DUAL str)

SELECT str

REGEXP_SUBSTR(str, '\w+',1,3) AS emp_no

OF tbl_data;

HTH

Tags: Database

Similar Questions

  • How to get the decimal value of a string of international currency

    Hi all

    How to get the decimal values to a string of international currency.

    Finally, we get to the real problem.

    You can use location functions or write your own using string functions already mentioned...

    http://developer.BlackBerry.com/native/documentation/Cascades/device_platform/internationalization/

  • Get the Ascii code of a string

    Hi all

    I need to get the ascii code of a character, and I can't find the appropriate function to do.

    For example, I get a string like this :--> 'X 6T8OP' and I want to turn it into this: 54 84 56 79 80 32 88

    Note: I'm using Labview 8.2

    Well thanks to all!

    Salvation of output,

    Use the function "string into byte array.

    Mike

  • Get the phone number of mixed string

    Hello

    I'm new to the development of BB and I can't seem to understand this.

    What I want to do is to take a mixed string (the event details for a google calendar event) and get a string that contains something that looks like a phone number. It seems to be already features to recognize the phone numbers of a string there are things like ActiveRichTextFields, and I can get my BB to highlight these regions 'active', but I can't get this phone in a separate channel number.

    I'm totally lost on this, any help would be appreciated.

    Welcome to the forum.

    I'm not aware of any API that allows to determine what parts of a string BlackBerry will recognize by default.  I have never seen this in a field that is displayed on the screen.

    My first reaction is that you have to watch yourself to find these special criteria.  I hope that others have an opinion / a different option.

  • How to get the current wording of the BlackBerry device with the BlackBerry App?

    Hello!

    I'm new to BlackBerry,

    Can u tell me pls, how to get the current language of the device using the program...

    PLS, suggest me...

    Locale.getDefaultForSystem () will give you the regional settings currently selected.

  • Get the recent words of customers Machines - Documents

    How can I get Documents recent words of customers Machines -

    declare

    kwordl client_ole2.obj_type;
    e client_ole2.obj_type;
    sFile client_ole2.obj_type;
    sfiles number;
    fname varchar2 (300);
    slist client_ole2.list_type;
    Coll varchar2 (4000);

    Start
    KWord: = client_ole2.create_obj ('word.application');
    recent: = client_ole2.get_obj_property (KWord, 'recentfiles');
    sfiles: = client_ole2.get_num_property (recent, 'count');

    for nloop in 1... sfiles
    loop
    slist: = client_ole2.create_arglist;
    sFile: = client_ole2.get_obj_property (recent, 'item', slist);
    client_ole2.destroy_arglist (SLIST);
    fname: = client_ole2.get_char_property (file, 'name');
    Coll: = coll | Chr (10) | fname;
    end loop;
    message (coll);
    client_ole2.release_obj (recent);
    client_ole2.release_obj (sFile);
    client_ole2.release_obj (KWord);
    end;

  • Get the long Word to continue in the cell without break area

    Hello

    I create a table that includes some codes that are a long string of characters. It would really help I could say the text to just continue in the round and fit into a cell in a table, without having to type a space (which would change the meaning and the appearance of the code) or increase the width of the column.

    It happens naturally in Word:

    Screen Shot 2015-08-14 at 15.05.19.png

    does anyone know how to achieve this in Indesign, please?

    Hi Emma,

    You can try to format your text with the language: "[no language].

    Just like that:

    See you soon,.

    Uwe

  • When you use my dynamic stamp I get the "undefined" Word where the text entered in the dialog box must be

    I get my dialog box open no problem I enter click data OK but the stamp shows that the text field is "undefined". "Text fields names are 'Due' and 'WorkOrder' in the photo below they appear"DueValue"and WOrkOrderValue", then the results as 'undefined' for both. I put the code at the bottom that I delete the section that caused the word "value" is displayed at the end of the deadline and order of business.

    < AcroForm >

    < ACRO_source > CaseNumField: calculate < / ACRO_source >

    < ACRO_script >

    / * belongs to: AcroForm:CaseNumField: calculate * /.

    var = {} dialog box

    DueValue:

    WorkOrderValue:

    function: Commit (dialog) {/ / called pressed OK}

    results var = dialog.store ();

    This. DueValue = results ["tx1"];

    This. WorkOrderValue = results ["tx2"];

    },

    Description:

    {

    name: 'Information stamp control', / / title of the dialog box

    elements:

    [

    {

    type: "display."

    elements:

    [

    {

    name: "reason: «,»»

    type: 'static_text. "

    },

    {

    item_id: "tx1"

    type: 'edit_text. "

    Multiline: true,

    Width: 200,

    height: 40

    },

    {

    name: "work order #: «,»»

    type: 'static_text. "

    },

    {

    item_id: "tx2"

    type: 'edit_text. "

    Multiline: true,

    Width: 200,

    height: 40

    },

    {

    type: "ok_cancel."

    ok_name: "Ok."

    cancel_name: "Cancel".

    },

    ]

    },

    ]

    }

    };

    If (event.source.forReal & & (event.source.stampName == "#VOfL_5866j3cq0GIzQbaLC"))

    {

    If ('ok' is app.execDialog (dialog))

    {

    CMSG = var dialogue. DueValue;

    Event.Value = "Due\n" + CMSG;

    event.source.source.info.DueValue = CMSG;

    CSMG is "Work Order\n" + dialog box. WorkOrderValue;

    this.getField("WorkOrder").value = CMSG;

    }

    }

    Title of the dialog box get ready unless the code is executed in a context of trust. It's a bit complicated to put up with a custom in a stamp file dialogue box, so I won't even try to explain it.

  • AS3: assigning values to the different words in a string

    Is there a way to locate a word (Group of characters) in a text box or a string and assign different values for them or even add an event listener for them?

    example:

    myText = "a solange once there was a little girl in a red cape";


    I want to find the word 'red' and color only in red and add an event listener. Is this possible?

    Of course it works

    You can do

    if(newcolor == 0xff0000){
         // do something for roll over
    } else {
         // do something for roll out
    }
    
  • E4X: How to get the items that contain a string pattern in the name of the node?

    Is there a way to retrieve the children of an XMLList where the name of the node of a child contains a template string?

    For example:

    account <>

    < XblahX / >

    < cow / >

    < YblahY / >

    < / recording >

    How to get items in folder which has a node name that contains the string "blah"?

    var rec: XML =

    ;

    var r: RegExp = / blah /;
    var elems:XMLList = rec.children (). (localName () *.search (r) >-1);
    trace (elems. ToXmlString())

  • I installed Windows 7. How can I get the programs WORD, EXCEL and POWERPOINT?

    I bought and installed WINDOWS 7. I can't find WORD, EXCEL and POWERPOINT. What should I do to use these programs?

    I bought and installed WINDOWS 7. I can't find WORD, EXCEL and POWERPOINT. What should I do to use these programs?

    If you do not have the original media, you must buy it. Any version of Windows ever don't come with office or one of its programs for free.

  • replace the nth word in a string

    Oracle 10g version

    example of
    WORDS ARE SEPERATED BY ^
    
    select REGEXP_REPLACE('DEEPAK1^DEEPAK1^DEEPAK',
                             'DEEPAK',
                             'DEEPAK1',
                             3,    --nth word 
                             1) from dual;
                         
    o/p required     := DEEPAK1^DEEPAK1^DEEPAK1
    select REGEXP_REPLACE('DEEPAK1^DEEPAK1^DEEPAK1^DEEPAK',
                             'DEEPAK',
                             'DEEPAK1',
                             4,                     --nth word 
                             1) from dual; 
    o/p required     := DEEPAK1^DEEPAK1^DEEPAK1^DEEPAK1
    Published by: new learning on March 4, 2011 12:22

    If you want to replace a nth Word, it could do:

    SQL> select REGEXP_REPLACE('DEEPAK1^DEEPAK1^DEEPAK1^DEEPAK',
      2                        '[^^]+',
      3                        'DEEPAK1', 1, 4) str from dual;
    
    STR
    -------------------------------
    DEEPAK1^DEEPAK1^DEEPAK1^DEEPAK1
    

    N is 4 in the example above.

    The 4th parameter is the accident, which is one of the reasons why it did not work. The trend was also hard-coded. I don't know if it of necessary or not.

  • Choose the Second word of the string

    How to get the second word in a string. Each word is separated from the space. If there is only a single word, to return the first word

    For example:

    "abc of anus ijk" I need to go back to

    If the string is

    'abc', I need to return to abc

    Thanks in advance

    Hello

    Try this:

    Select NVL (regexp_substr (your_string, "[^ [: space:]] +' 1, 2"), your_string) double

  • Get the string invalid Base64 of image of toDataURL() for the first time in 10 of blackberry webworks

    Hello

    I need to get the Contact image converted to string Base64 using BB 10 Webworks (blackberry.pim.contacts) I get only the contact.photos [0] .smallFilePath which returns the path to the phonebook file.

    Now, I want to get the image of this path and convert it to a Base64 string.

    Here's the javascript code :

    var img = document.createElement ('Image');
    var canvas = document.createElement ('Canvas');

    function getBase64Image (p) {}
    img.setAttribute ("src", p);

    Img.width = Canvas.Width;

    Canvas.height = img.height;

    CTX var = canvas.getContext ("2d");
    ctx.drawImage (img, 0, 0);
    Return canvas.toDataURL("image/jpg");

    }

    This means bad Base64 string of image for the first time. When I convert this string to the image it displays white screen. But returns a string in the Mithraeum and after conversion, display a correct image.

    I use Blackberry Z10 (OS 10) for the test.

    I think that the canvas is not drawing image properly for the first time.

    I have searched and tried many things, but not got success. What will be the solution.

    Thanks in advance.

    My guess is that the image did not load the source completely still. Setting the src / image loading is an asynchronous event, which means that your code will continue to the next line regardless of whether the image has loaded yet or not.

    After calling setAttribute instead of execute the code of the Web, you will probably need define an event on img for the load event listener. Once the image is loaded, you can then use the img with canvas variable to retrieve its data.

    Note that getBase64 will return immediately, so you may need to develop some sort of mechanism to wait before returning, or the asynchronous approach and integrate reminders for the success trigger the next piece of code.

  • How can I get the contents of an object of Document (XMLDOM) in a string variable?

    Hello

    I created an XML document by using the Document and XMLElement classes and now I need to get the XML object and a string variable, so I can send by e-mail.

    I'm on 4.5 JDE

    Help!

    Hello

    Unlike some other posts, there is a solution.

    Document myDocument = pdocXMLDocument;  / * This is the document that you created that you want to convert to a string

    ByteArrayOutputStream OS = new ByteArrayOutputStream(); / * where you want the XML to go * /;
    XMLWriter writer = new XMLWriter (os);

    configure as you want using one or more of:
    writer.setPrettyPrint (); or setPrintCompressedOutput();
    writer.setPrintCompressedOutput ();
    writer.setPreserveSpacing ();
    writer.setExpandingEntities (boolean);
    writer.setEntityResolver (EntityResolver);
    try {}
    DOMInternalRepresentation.parse (pdocXMLDocument, writer);
    String myXML = os.toString ();        THIS IS THE STRING
    }
    catch (Exception ex) {}
    }

Maybe you are looking for

  • Password

    Hi all... Just buy a mcbook pro, but I can not open required it... it's a password but I do not have anything... hope - can someone help me... Thank you

  • Need Driver DVD Decoder - Tecra 780DVD

    I reinstall my system yesterday with win98se, but I can´t find the Driver for the integratet DVD decoder card. Can someone help me find them? Any other driver I downloadet the Canadian homepage of Toshiba.

  • I have a drop down list with categories, how to close the categories?

    Hello I created the drop-down list categories and in each line, I'll choose a category in the menu dropdown.  How to add each category? It's the number 3.6.1 (2566), El Capitan That is to say. gas meal Rental I want to make the sum of all the lines t

  • Install the HP Laserjet Printer drivers

    How to install drivers for a HP4700 Color Laserjet? I tried to add a printer on my 'new' computer and found out that there are no drivers available for an HP4700 Color Laserjet. If I use the generic driver, I get a quality poor printing B & W out. I

  • Repair VI.lib

    Is it possible to fix the vi.lib? I noticed that there are several dependencies in my project that came from other independent projects in one of my projects. Then, I started to find the number of callers to this VI.  He ends by that somehow some of