How to get these substrings based on the string entered

Hi friends
i want the substring entered in the string
the string is something like this: 1234,3653,7684,3254,8777,987,234
now i want
the substrings between commas
can some one help me with it pls
in the first substring i need 1234
in the second i need 3653...
so on till the end..
what ever the string be until the last one
pls help

Hi,
You can do something like this:
SELECT     txt
,     REGEXP_SUBSTR (txt, '[^,]+', 1, 1)     AS part_1
,     REGEXP_SUBSTR (txt, '[^,]+', 1, 2)     AS part_2
,     REGEXP_SUBSTR (txt, '[^,]+', 1, 3)     AS part_3
FROM     table_x
;If there are fewer than n parts, then the technique above will not raise an error; it will just return NULL for part_n.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and the results you want from that data.
Explain how you get those results from that data.
What do you want if the input is like this"
{code}
'foo,,bar'
{code}
? Do you want to consider this as 2 parts ('bar' is the 2nd) or a s 3 (the 2nd is NULL, and 'bar' is the 3rd)? Include examples in your sample data and results.
Always say what version of Oracle you're using.

Similar Messages

  • How to Get Exchange rates based on the date ?

    Hi Friends,
    I have a table called "ZEXCH" with fields MANDT, BUDAT, WAERS, KURSF. This is a maintainable table .... (ie) user can keep on adding the Exchange rates for the currencies for a particular date....
    My table contents are:
    MANDT BUDAT      WAERS   KURSF      
    080   30.08.2002 USD        50.00000
    080   30.01.2006 USD        40.00000
    080   09.03.2006 USD        30.00000
    Now if i run the report with Budat = 31.12.2002 it should pick up line item 1.
    similarly if i run the report with Budat = 31.03.2006 it should pick up line item 2.
    similarly if i run the report with Budat = 31.05.2006 it should pick up line item 3.
    How could i do this????
    Expecting your answers
    thanks in advance...
    Cheers
    R.Kripa.

    Hi,
      Use the following code snippet, you need to have the 'exchange rate type' as one of the fields in order to distiguish between different rate types, the standard rate type used in most of the cases is 'M',
    select KURSF from zexch
            into zexch-KURSF
            up to 1 rows
            where kurst = 'M'
            and   fcurr = 'USD'
            and   tcurr = 'INR'
            and   BUDAT >= Date given in the selection.
            endselect.
    Hope this helps,
    Rgds,

  • How to create a record based on the name of a file in the file-system?

    Hi,
    With a lot of pictures I want to have a database to gather some information about these pictures.
    First question is how to generate a record based on a file in the file system?
    e.g. the pictures are "c:\fotos\2009\01\disc_001.jpg" to "c:\foto\2009\01\dis_98.jpg" .
    now i want to create records with as one of the attributes the name of the picture (not the picture itself). how to create these records (based on the information of the file-ssytem). i.e. the number of records should be the same as the number of pictures.
    any suggestions?
    any reaction will be appreciated.
    Leo

    Link to Create directory
    http://www.adp-gmbh.ch/ora/sql/create_directory.html
    You can create a list of files in the directory and read the list files from that directory.
    [UTL_FILE Documentation |http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/u_file.htm#996728]
    [Solution using Java|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584]
    SS

  • TS1702 When I try to update two certain apps in the App Store, I get a message that says 'cannot connect to iTunes store'. Any idea how to get these apps to update?

    When I try to update two certain apps in the App Store, I get a message that says 'cannot connect to iTunes store'. Any idea how to get these apps to update?

    Check that the apps are still available in the store

  • My Apple TV was set up with a different Apple ID than I have for my ITunes Account.  In other words I have multiple Apple ID's.  How can get these accounts to sync up?

    My Apple TV was set up with a different Apple ID than I have for my ITunes Account.  In other words I have multiple Apple ID's.  How can get these accounts to sync up?

    If you wish to use home sharing then you need to setup the Apple TV under your ID.

  • My dad has itunes on his PC. I don't have my own but I recently have an iPad mini and an iPod. I don't know how to get songs onto itunes on the PC, using a different account or at least private/ separate..

    My dad has itunes on his PC. I don't have my own but I recently have an iPad mini and an iPod. I don't know how to get songs onto itunes on the PC, using a different account or at least private/ separate..
    So how do I create a separate I tunes on a PC which already has itunes... Or if not can I plug my iPad to the PC and use itunes on my iPad, and drag mp3s from a computer.
    I'm not sure what the equivalent of a desktop is on the iPad.. And I don't actually know how to use the icloud either...
    Can anyone start me off, given it have a iPad and use of a PC - not mine with existing iplayer
    I do have spotify soundcloud so I could potentially use these.. If there is a route of getting either mp3's etc to end up on my iPad or iPod.
    Kind Regards

    iTunes 11
    If you  have iTunes 11 turn on the Sidebar.  Go to iTunes>View and click on Show Sidebar. You can also do a Crtl+S to show the sidebar. The sidebar is where Devices appears. and Control+B to show the Menu bar
    To import music into your iTunes library on the computer go to iTunes>Help>iTunes Help>Add items to iTunes and follow the instructions
    To sync to your iPod go to iTunes>Help>iTunes Help>Sync your iPod....>Sync You Device and follow the instructions.

  • How to get these values?

    This sample output of trcsess shows the consolidation of traces for a particular
    session. In the following example the session index and serial number equals 21.2371.
    trcsess session=21.2371My question is: what are session index and serial number here? How to get these values?

    As per the tuning doc:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/sqltrace.htm#i20110
    You get these values from the V$SESSION view.
    Session Index = SID
    Serial number = SERIAL#

  • How to get a check box on the selection screen

    Hi all
    can any body tell me how to get a check box on the selection screen

    parameter: pa_check   as checkbox.
    To define the input field of a parameter as a checkbox, you use the following syntax:
    PARAMETERS <p> ...... AS CHECKBOX ......
    Parameter <p> is created with type C and length 1. In this case, you may not use the additions TYPE and LIKE. Valid values for <p> are ' ' and 'X'. These values are assigned to the parameter when the user clicks the checkbox on the selection screen.
    If you use the TYPE addition to refer to a data type in the ABAP Dictionary of type CHAR and length 1 for which 'X' and ' ' are defined as valid values in the domain, the parameter automatically appears as a checkbox on the selection screen.
    REPORT DEMO.
    PARAMETERS: A AS CHECKBOX,
    B AS CHECKBOX DEFAULT 'X'.

  • How to enable/disable the input fields based on the data entered/user action in the web dynpro abap?

    How to enable/disable the input fields based on the data entered in the web dynpro application abap?  If the user enters data in one input field then only the next input field should be enabled else it should be in disabled state. Please guide.

    Hi,
    Try this code.
    First create a attribute with the name readonly of type wdy_boolean and bind it read_only property of input field of which is you want to enable or disable.
    Next go to Init method.
    Set the readonly value as 'X'.
    DATA lo_el_context TYPE REF TO if_wd_context_element.
         DATA ls_context TYPE wd_this->element_context.
         DATA lv_visible TYPE wd_this->element_context-visible.
    *   get element via lead selection
         lo_el_context = wd_context->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_context IS INITIAL.
         ENDIF.
    *   @TODO fill attribute
    *   lv_visible = 1.
    *   set single attribute
         lo_el_context->set_attribute(
           name =  `READONLY`
           value = 'X').
    After that Go to the Action  ENTER.
    First read the input field ( first input field, which is value entered field) , next give a condition
    if input value is not initial  then set the readonly value is '  '.
    DATA lo_nd_input TYPE REF TO if_wd_context_node.
         DATA lo_el_input TYPE REF TO if_wd_context_element.
         DATA ls_input TYPE wd_this->element_input.
         DATA lv_vbeln TYPE wd_this->element_input-vbeln.
    *   navigate from <CONTEXT> to <INPUT> via lead selection
         lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
    *   @TODO handle non existant child
    *   IF lo_nd_input IS INITIAL.
    *   ENDIF.
    *   get element via lead selection
         lo_el_input = lo_nd_input->get_element( ).
    *   @TODO handle not set lead selection
         IF lo_el_input IS INITIAL.
         ENDIF.
    *   get single attribute
         lo_el_input->get_attribute(
           EXPORTING
             name =  `VBELN`
           IMPORTING
             value = lv_vbeln ).
    if lv_vbeln IS not INITIAL.
        DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_visible TYPE wd_this->element_context-visible.
    *  get element via lead selection
        lo_el_context = wd_context->get_element( ).
    *  @TODO handle not set lead selection
        IF lo_el_context IS INITIAL.
        ENDIF.
    *  @TODO fill attribute
    *  lv_visible = 1.
    *  set single attribute
        lo_el_context->set_attribute(
          name =  `READONLY`
          value = ' ' ).

  • How to get list of permissions for the PCD location

    Hello Team,
    I have group called "ABC". We have lots of roles created in PCD, and some of the roles are assigned to "ABC" group. I want to list out all the roles which is added to the group "ABC".
    Can you please help me?
    Thanks
    Manoj K

    Hi,
    Thanks for the reply.
    Yes, i would like to know what are all the PCD roles which are assigned to group "ABC".
    Yes, you are right, that we can select the group in user Management and if we click on the "Assigned roles" and if we use the string * then we will get a list.
    But if i do that, it is giving below information.
    Last search returned 134 elements. This exceeded the defined max hits of 50. Narrow your search criteria and search again.
    So,this information i got when i select the Search Recursive button, So, i want to know how to get these 134 list from User Management.
    Thanks
    Manoj K

  • How to get fiscal period based on date and Fiscal year?

    Hi Guys,
               Can anybody tell me how to get Fiscal period based on date and Fiscal Year or fiscal year variant?
    Thanks,
    Gopi.

    Hi,
    Please refer the code below:
    *: Report:  ZFISCALYR                                                  :
    *: Date  :  2004                                                       :
    *: Description: Demonstrates how to return the corresponding fiscal    :
    *:              year and posting period for a company code and posting :
    *:              date or posting date and fiscal year variant.          :
    REPORT  zfiscalyr NO STANDARD PAGE HEADING.
    TABLES: ekko.
    PARAMETERS:     p_bukrs TYPE ekko-bukrs,
                    p_bedat TYPE ekko-bedat.
    DATA: gd_fiscalyr  TYPE bapi0002_4-fiscal_year,
          gd_fiscalp   TYPE bapi0002_4-fiscal_period.
    DATA: gd_fiscalyr2 TYPE T009B-BDATJ,
          gd_fiscalp2  TYPE bapi0002_4-fiscal_period.
    DATA: gd_periv     TYPE t009-periv.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    * get fiscal year and period - (requires date and company code)
      CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
        EXPORTING
          companycodeid = p_bukrs
          posting_date  = p_bedat
        IMPORTING
          fiscal_year   = gd_fiscalyr
          fiscal_period = gd_fiscalp.
    * Alternative fiscal year function module
    * - (requires date and fiscal year variant code from T009 table)
    * gets first entry in fiscal year variant table (will need to choose
    * correct one from table rather than just using first entry)
      SELECT SINGLE periv
        FROM t009
        INTO gd_periv.
    * get fiscal year and period
      CALL FUNCTION 'DETERMINE_PERIOD'
        EXPORTING
          date                      = p_bedat
    *    PERIOD_IN                 = '000'
          version                   = gd_periv
       IMPORTING
          period                    = gd_fiscalp2
          year                      = gd_fiscalyr2
       EXCEPTIONS
          period_in_not_valid       = 1
          period_not_assigned       = 2
          version_undefined         = 3
          OTHERS                    = 4.
    *END-OF-SELECTION.
    END-OF-SELECTION.
      WRITE:/ 'From function module: BAPI_COMPANYCODE_GET_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr,
            / 'Fiscal period is:', gd_fiscalp.
      SKIP.
      WRITE:/ 'From function module: DETERMINE_PERIOD',
            / 'Fiscal year is:', gd_fiscalyr2,
            / 'Fiscal period is:', gd_fiscalp2.
    Thanks,
    Sriram Ponna.
    Edited by: Sriram Ponna on Apr 17, 2008 8:59 PM

  • How to get deleted photos back in the trash can?

    I tried to dele all the photos I've deleted from iPhoto by cmd+delete all the photos in the iPhoto trash can, but that only made all the photos reappear in iPhoto.
    How do I get the deleted photos back in the trash can?
    I discovered this the next time I turned on my mac, so I couldn't just "go back".
    I really don't wanna go trough ALL of my pictures and delete the thousands of pictures I've deleted over the past three years..
    I now know how to delete dem properly, but not how to get them all back in the trash can. Please help me!
    Ida

    There's no way to do that. If you try and trash thousands of photos at one go you'll trash the Library - which is what sounds like you've done.
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  

  • How to get BP kind based on user name?

    Hi,
    How to get BP kind based on user name?
    Is there any table other than BUT000 which gives the Business partner no. and BP KIND?
    What is BLUEPRINT table?

    Hi John,
    do you mean Type:
    1     Person
    2     Organisation
    3     Group
    or Role like
    000000     Business Partner (General)
    BBP000     Vendor
    BBP001     Bidder
    BBP002     Portal Provider
    BBP003     Plant
    BBP004     Purchasing Company
    BEA001     Billing Unit
    BUP001     Contact Person
    BUP002     Prospect
    BUP003     Employee
    BUP004     Organizational Unit
    BUP005     Internet User
    The Role can be found in BUT100.
    Regards
    Gregor

  • My e-mail has quit updating.  Anybody know why or how to get it started back?  The result is that I dont get my e-mails on the phone.

    My e-mail has quit updating. Anybody know why or how to get it started back?  The result is that I can not get e-mails on my phone.

    Thank you for the info re. the main menu. Your answer I used worked; however, the menu bar all the way across is solid black. The only way I can find out the names on the menu is to point the cursor from left to right over the black bar to find "file" "edit" tools", etc. What do I need to do to get these menu titles to be seen?
    As regarding the GMail --the menu bar used to have an envelope symbol which was white and outlined in red. That disappeared. I googled "mail.google.com" to try to get back my email. This didn't work. I then tried to get a different email address and password--after 8-19 attempts, this never worked. My other email (sbcglobal.net) has never returned. So I don't know where that went or how to get it back

  • I'm really disappointed with new 5 update.  No music, No photos, No videos, lost all emails.  Anyone know how to get these all back?  Yes, I have synced and synced and synced.  Help

    I'm really disappointed with new 5 update.  No music, No photos, No videos, lost all emails.  Anyone know how to get these all back?  Yes, I have synced and synced and synced.  Help

    Hopefully it isn't too late for this but:  before performing an update it is really best if you close all apps (double click the home button, click and hold on one of the apps that appears at the bottom of the phone until the red minus sign appears and then tap the minus sign until all apps are closed) and then turn the phone off by holding the standby button until the slider saying "slide to power off" appears and slide it to turn the phone off.  Then turn the phone back on and hook it up to your computer to sync and perform the upgrade.  This also helps if you do this before performing syncs too.  I had problems with an iPod previously where it would fail to backup before sync most times, but have never had a problem with updates or syncs since I started performing this procedure.  Unfortunately, your pre-update backup may have failed and the data in your apps might be gone, but you could try to restore your phone.  If I remember correctly how to do this, you connect it to your computer and check for updates.  It should say you're up to date, but have an option to restore the phone.  If it does, I'd try that.  It may also have a "restore from backup" option you could try.

Maybe you are looking for