I need to trim out the second word of a string

If the string is as follows I need to always return the second word:
This is an example. (I need to return 'is')
Another example string. (I need to return 'example')

You can also use owa_pattern for pattern matching.
See Oracle 9i Application Server PL/SQL Web Toolkit Reference, Release 1.0.2.2, Part Number A90101-01, Chapter 6
http://otn.oracle.com/docs/products/ias/doc_library/1022doc_otn/apps.102/a90101/pspatt.htm
SQL> set verify off
SQL> define my_string = "This is an example"
SQL> select
  2     '|' ||
  3     substr ('&my_string',
  4             owa_pattern.amatch ('&my_string', 1, '\S*\s*'),
  5             owa_pattern.amatch ('&my_string', 1, '\S*\s*\S*\s?')
  6                 - owa_pattern.amatch ('&my_string', 1, '\S*\s*')
  7            )
  8     || '|' as second_word
  9   from dual ;
SECOND_WORD
|is |
SQL> define my_string = "Another example string"
SQL> /
SECOND_WORD
|example |
SQL> define my_string = "one"
SQL> /
SECON
||
SQL> define my_string = "one two"
SQL> /
SECOND_WO
|two|
SQL>

Similar Messages

  • HT201320 I have an email account through yahoo. I am having trouble setting it upon my iPhone and can't receive or send emails!!!! I contacted Rogers and they said I need to find out the host name of the incoming server, in other words yahoos host name. H

    I have an email account through yahoo. I am having trouble setting it upon my iPhone and can't receive or send emails!!!! I contacted Rogers and they said I need to find out the host name of the incoming server, in other words yahoos host name. Help!!

    Yahoo's servers are notoriously unreliable. Use the "Yahoo" account type when setting it up. If it doesn't work, and you are positive the credentials are correct, wait a while and try again.
    While you're waiting, set up a free gmail or iCloud email account.

  • How do i open a secured document,need to prin out the contents?

    How do I open a secured document? I need to print out the contents.

    Mail the Word document, and when you click the attachment in IOS 8 Mail, the Word document will open in Pages v2.4.2 (required for IOS 8). If password protected, you will receive a password challenge when you attempt to open the document.

  • Sometimes my computer takes too long to connect to new website. I am running a pretty powerful work program at same time, what is the best solution? Upgrading speed from cable network, is it a hard drive issue? do I need to "clean out" the computer?

    Many times my computer takes too long to connect to new website. I have wireless internet (time capsule) and I am running a pretty powerful real time financial work program at same time, what is the best solution? Upgrading speed from cable network? is it a hard drive issue? do I only need to "clean out" the computer? Or all of the above...not to computer saavy.  It is a Macbook Pro  osx 10.6.8 (late 2010).

    Almost certainly none of the above!  Try each of the following in this order:
    Select 'Reset Safari' from the Safari menu.
    Close down Safari;  move <home>/Library/Caches/com.apple.Safari/Cache.db to the trash; restart Safari.
    Change the DNS servers in your network settings to use the OpenDNS servers: 208.67.222.222 and 208.67.220.220
    Turn off DNS pre-fetching by entering the following command in Terminal and restarting Safari:
              defaults write com.apple.safari WebKitDNSPrefetchingEnabled -boolean false

  • How to find out the stop words of an index?

    I am sure it's something very easy but:
    I want to find out the stop words that i am using in a particular index via SQL query?
    I had several indexes with diferent stoplists.
    Thanks

    I already found out.
    thanks.
    for anyone also looking see
    select * from ctx_stopwords;

  • HT5538 I bought my iPad at the pawnshop and I need to sign out the old Apple ID can you please help me what else can I do

    I bought my I pad at the pawnshop and I need to sign out the previous Apple ID could you please help me with this

    If you are trying to activate an iPad or iPhone and it is asking for a previous owners Apple ID and password, you have encountered the Activation Lock. This is a security feature that prevents thieves from setting up and using a stolen or lost iPad or iPhone. You have no alternative. You must contact the previous owner to get permission to use the device. If you cannot contact the previous owner return the device to where you bought it and get a refund. You will never be able to activate the device and no one can help you do it.

  • I am moving from Southern California to Maui, Hawaii and I need to figure out the best way to get my 24 inch iMac across the ocean. Does anyone know the best way to do this?

    I am moving from Southern California to Maui, Hawaii and I need to figure out the best way to get my 24 inch iMac across the ocean. Does anyone know the best way to do this? I have found GearGrip's LCD harness so that I can do carry-on onto the plane...  Or maybe use a Pelican Case to do it as a "checked bag"? Or any other suggestions??! Please help!
    Thanks so much!!

    I don't recommend you send the iMac in a checked bag. Might get damaged.
    Check the airlines website for carry on guidelines.
    Or, if you have the original box that the iMac came in, if you have someone who can pick up the iMac for you, send it ahead Fed Ex and insure the package.
    Just make sure the display is covered to protect it. A blanket perhaps.
    Aloha ...

  • [svn:bz-trunk] 20680: Tomcat 7 Login Module work, due to the Tomcat 7 Security framework change we need to work out the security integration piece for tomcat 7 .

    Revision: 20680
    Revision: 20680
    Author:   [email protected]
    Date:     2011-03-08 08:23:30 -0800 (Tue, 08 Mar 2011)
    Log Message:
    Tomcat 7 Login Module work, due to the Tomcat 7 Security framework change we need to work out the security integration piece for tomcat 7. So far the ValveBase and tomcat Realm had API changes which will impact on the Login integration with Tomcat 7
    Modified Paths:
        blazeds/trunk/modules/opt/build.xml
    Added Paths:
        blazeds/trunk/modules/opt/lib/catalina-708.jar
        blazeds/trunk/modules/opt/src/tomcat/flex/messaging/security/TomcatValve708.java

    Revision: 20680
    Revision: 20680
    Author:   [email protected]
    Date:     2011-03-08 08:23:30 -0800 (Tue, 08 Mar 2011)
    Log Message:
    Tomcat 7 Login Module work, due to the Tomcat 7 Security framework change we need to work out the security integration piece for tomcat 7. So far the ValveBase and tomcat Realm had API changes which will impact on the Login integration with Tomcat 7
    Modified Paths:
        blazeds/trunk/modules/opt/build.xml
    Added Paths:
        blazeds/trunk/modules/opt/lib/catalina-708.jar
        blazeds/trunk/modules/opt/src/tomcat/flex/messaging/security/TomcatValve708.java

  • 10 laksh records and need to find out the top5 salary

    Hi,
    I have emp table with 10 laksh records and need to find out the top5 salary.I formed the below mentioned query,
    SELECT ROWNUM,SAL,EMPNO,ENAME,DEPTNO FROM(SELECT ENAME,EMPNO,
    DEPTNO,SAL FROM EMP ORDER BY SAL DESC) WHERE ROWNUM<=3 AND SAL IS NOT NULL;
    i would like tune this query or anyother new qeury find out top5 salary.
    By
    Siva

    kn_sivaraman wrote:
    Hi,
    I have emp table with 10 laksh records and need to find out the top5 salary.I formed the below mentioned query,
    SELECT ROWNUM,SAL,EMPNO,ENAME,DEPTNO FROM(SELECT ENAME,EMPNO,
    DEPTNO,SAL FROM EMP ORDER BY SAL DESC) WHERE ROWNUM<=3 AND SAL IS NOT NULL;
    i would like tune this query or anyother new qeury find out top5 salary.
    By
    SivaWhy do you need to Tune? What do you need to tune?
    What is the execution time of the query? What is the explain plan?
    Moreover, in an International forum, refrain from using Locals. 10 Lakhs = 1 Million.
    Do provide the above details to determine if your query needs tuning?
    Below is a correct version of Top N query. Untested for your example. Please do modify according to your needs.
    SELECT ROWNUM,
      SAL,
      EMPNO,
      ENAME,
      DEPTNO
    FROM
      (SELECT ENAME,EMPNO, DEPTNO,SAL, dense_rank() over(order by sal desc nulls last) dr
        FROM EMP ORDER BY SAL DESC
      ) a
    WHERE a.dr <= 5;Regards,
    P.

  • Need to find out the account group given the accounting document number

    I am new to SAP. Please help.
    Need to find out the account group given the accounting document number?

    If you are asking about account assignment group then that can be seen in billing document -> Header -> Accounting Data.

  • Need to find out the queries which did not executed in 2014

    Hi All,
    I need to find out the queries which start from YY  and did not executed in 2014, earlier we used to find out by looking into the technical content cube 0TCT_C02 but now its giving dump as number of queries increases. I tried to find out using table RSZCOMPDIR but not able to trace it exactly. Please suggest some alternative solution to find out the queries which did not execute in 2014 so that we can delete it.
    Thanks,
    Asim.

    Hi,
    RSDDSTAT_OLAP : This is the table which contains query execution details
    CALDAY field in that table gives you query execution date
    OBJNAM gives the query name
    As you said RSZCOMPDIR gives list of all queries. doing a lookup between these tables will identify the queris which are not executed in particular period.
    -Sriram

  • Need to find out the number of Master data records transfered to the BW

    Hi,
    We need to find out the number of Master data (example -0MAT_PLANT_ATTR) records to be transfered to BW side. This is a delta extract.  We are preparing test scripts to check the master data extract ( full & delta) from ECC6 TO BI 7.0..
    Advance Thanks.

    Hi,
    Goto RSA3 and run that master data extractor in D mode if you want to know the number of records in delta and in F mode if you want to know the Full volume. But make sure that you set data records/calls and the display extr calls numbers so that you get the total number of records.
    The other option is goto the master data source table and look at the number of records in that table. That'll give you an idea of the total number of records in the table.
    One other option is to goto RSA7 , select the delta datasource and hit the display button. You'll get to know the number of entries in the delta queue that way as well.
    Cheers,
    Kedar

  • Desktop CC logs me out the second i log in

    desktop CC logs me out the second i log in-- website login works fine.  Tried uninstalling CC and reinstalling but it still logs me out immediately after i log in.
    thx in advance, -john

    Sign Out When Sign In http://forums.adobe.com/thread/1450581?tstart=0 may help
    -and http://helpx.adobe.com/creative-cloud/kb/unable-login-creative-cloud-248.html

  • HT1438 do i need to take out the SIM card before erasing data or after

    Hello,
    I need to erase data form iphone 4S, do i need to take out the SIM card before erasing data or after?

    Do a back up first to icloud or itunes on your pc. then erase all contents and settings.

  • I need to print out the response forms.  How do I do it?

    I need to print out the response forms.  How do I do it?

    They are saved as PDF files, so you just need to install Adobe Reader, which you can download for free: http://get.adobe.com/reader/

Maybe you are looking for

  • Need help with transferring iTunes library to different computer

    My old iPod stopped working so I bought a new one.  For my older iPod I use a different computer but I want to use a different computer for my new iPod.  I have all my songs on an external hard drive and I want to use that for my other computer.  How

  • Can not login with telnet

    I'm trying to connect to a cisco switch via telnet with Putty. The session looks like it connects but I'm pressented with a blank screen - no logon prompt. The switch is still working as my solarwinds monitoring has not complained about any of the po

  • Help centering a box in a jpanel

    hi every1, I need some help centering a box in a jpanel both horizontally and vertically. which layout is the correct one? could you post a scrap of code please? thanxalot stefano

  • Problemas con photoshop CS5

    He instalado bien el Photoshop CS5, pero al registrarlo no acepta mi clave del ID de adobe (me sale un mensaje que dice que lo intente nuevamente màs tarde) ya han pasado los 30 días de prueba y se ha deshabilitado el programa, y no puedo habilitarlo

  • Considering the PXI-8420/16 as a solution for running one application to communicate to multiple devices.

    I am developing an application that needs to communicate through a serial interface to several devices under test at the same time.Would the PXI-8420/16 be a solution??