How to Splilit The String Into Single Column using Comma As Delimiter ?

How to Splilit The String Into Single Column using Comma As Delimiter ?
using Function

refer my thread ,code is also available see if that helps you
error while executing the sp ORA-21779: duration not active

Similar Messages

  • How to Store Encrypted String into OracleDatabase Column(vacrchar2)

    Hi..
    I encountered an error while inserting a Encryted String into oracle column.. Error "Quoted String Doesn't terminated properly"
    But i wrote Query string correctly and using Datatypes as String and vacharchar2(2000) in java and oracle respectively..
    what i need to do?

    Hi,
    if your code compose the sql programmatically without bind variables i.e.:
    String sqlInsert="insert into table A(encrypted_column) values ('" + encryptedValue+ ')");
    then if the string encryptedValue contains a ' character you end up with a wrong sql statement
    if you encryped values is something like AAABB#??£££'AAA the corresponding sql is
    insert into table A(encrypted_column) values ('AAABB#??£££'AAA')
    which is not correct becaus of the ' in the middle of the string.
    Giovanni

  • Breaking the string into different columns

    Hi Guys,
    I need to break the following string into different columns
    'XXXXX.0001.09011.0001.00002.03.0004.0005.0006.00007.'
    I am trying to write it using instr and substr , but having some issues .
    Is there any other way to do this. If not can someone help me , below is the query that i am working on
    SELECT SUBSTR ('XXXXXX.0001.09011.0001.00002.03.0004.0005.0006.00007', 1, INSTR ('XXXXXX.0001.09011.0001.00002.03.0004.0005.0006.00007', '.', 1) - 1) col1,
    SUBSTR ('XXXXXX.0001.09011.0001.00002.03.0004.0005.0006.00007',
    INSTR ('XXXXXX.0001.09011.0001.00002.03.0004.0005.0006.00007', '.', 1) + 1,
    INSTR ('XXXXXX.0001.09011.0001.00002.03.0004.0005.0006.00007', '.', 1, 2)
    - INSTR ('XXXXXX.0001.09011.0001.00002.03.0004.0005.0006.00007', '.', 1)
    - 1
    ) col2,
    SUBSTR ('XXXXXX.0001.09011.0001.00002.03.0004.0005.0006.00007',
    INSTR ('XXXXXX.0001.09011.0001.00002.03.0004.0005.0006.00007', '.', -1, 2) + 1,
    INSTR ('XXXXXX.0001.09011.0001.00002.03.0004.0005.0006.00007', '.', -1, 1)
    - INSTR ('XXXXXX.0001.09011.0001.00002.03.0004.0005.0006.00007', '.', -1, 2)
    - 1
    ) col3
    from dual
    It is very urgent.
    Thanks in advance.

    npejavar wrote:
    It is very urgent.
    It doesn't look urgent, you could simply read the manuals for instr and substr or describe any issues or errors you are having, or post sample data so people could help you more easily, or format your code so it is more readable, but you don't bother to do any of those things so if it isn't important to you to extend any effort, why would it be important to us?
    If it was really urgent it would be a violation of the conditions of use of these forums.
    http://www.catb.org/esr/faqs/smart-questions.html#urgent
    http://www.oracle.com/html/terms.html
    >
    4. Use of Community Services
    Community Services are provided as a convenience to users and Oracle is not obligated to provide any technical support for, or participate in, Community Services. While Community Services may include information regarding Oracle products and services, including information from Oracle employees, they are not an official customer support channel for Oracle.
    You may use Community Services subject to the following: (a) Community Services may be used solely for your personal, informational, noncommercial purposes; (b) Content provided on or through Community Services may not be redistributed; and (c) personal data about other users may not be stored or collected except where expressly authorized by Oracle

  • How to load dynamically String into a VI using LabVIEW Run-time Engine Version 7.0?

    I would like to be able to traduce string into my application using import string method. I create an program with my VI to translate. When I use the import method, I get this error: the VI is locked. WHY ? because it works well in the edit mode but not using LabVIEW Run-time Engine Version 7.0 .

    Hello loup,
    If you call dynamically a VI in your LabVIEW application you must add this VI when you build the .exe file.
    To add this VI, go to the Tab "Source Files" when you build application and click on "Add Dynamic VI..." then chose the VI you call.
    It should solve your problem.
    In the attached file you can found an example of LV program that translate front panel.
    Try to build exe file and add "Languages.vi" as dynamic VI and .txt files as "Support files".
    I test it, it works.
    I hope that this will help you.
    Best Regards,
    Sanaa T
    National Instruments
    Attachments:
    Translation.zip ‏69 KB

  • How to append the string into blob content

    the blob column will have a string with comma separated values which needs to be changed to column wise data and update it back with the existing BLOB content.
    string like:-'V,CTMF,1.0,M,ICD-9 to 10 CM,CODE_COMMENTS_UPLOAD,0,A,bsns,2012-04-01,Author,pa admin,Comment,50 Record Map,F,Vascular,C,M'
    after i got splitting the values to column wise:
    V
    CTMF
    1.0
    M
    ICD-9 to 10 CM
    CODE_COMMENTS_UPLOAD
    0
    A
    bsns
    2012-04-01
    Author
    pa admin
    Comment
    50 Record Map
    F
    Vascular
    C
    M
    finally i need the blob append data output look like below,please do the needful................
    blob_value
    V,CTMF,1.0,M,ICD-9 to 10 CM,CODE_COMMENTS_UPLOAD,0,A,bsns,2012-04-01,Author,pa admin,Comment,50 Record Map,F,Vascular,C,M
    V
    CTMF
    1.0
    M
    ICD-9 to 10 CM
    CODE_COMMENTS_UPLOAD
    0
    A
    bsns
    2012-04-01
    Author
    pa admin
    Comment
    50 Record Map
    F
    Vascular
    C
    M

    actually
    my blob column values is:
    V,CTMF,1.0,M,ICD-9 to 10 CM,CODE_COMMENTS_UPLOAD,0,A,bsns,2012-04-01,Author,pa admin,Comment,50 Record Map,F,Vascular,C,M
    splitting column wise data is:-**
    V
    CTMF
    1.0
    M
    ICD-9 to 10 CM
    CODE_COMMENTS_UPLOAD
    0
    A
    bsns
    2012-04-01
    Author
    pa admin
    Comment
    50 Record Map
    F
    Vascular
    C
    M
    now i am appending the string to blob content at the end of the line only like
    V,CTMF,1.0,M,ICD-9 to 10 CM,CODE_COMMENTS_UPLOAD,0,A,bsns,2012-04-01,Author,pa admin,Comment,50 Record Map,F,Vascular,C,MVCTMF1.0MICD-9 to 10 CMCODE_COMMENTS_UPLOAD0Absns2012-04-01Authorpa adminComment50 Record MapFVascularCM
    but my requirement is should be to append the column wise data to existing blob column as new line like:
    V,CTMF,1.0,M,ICD-9 to 10 CM,CODE_COMMENTS_UPLOAD,0,A,bsns,2012-04-01,Author,pa admin,Comment,50 Record Map,F,Vascular,C,M
    VCTMF1.0MICD-9 to 10 CMCODE_COMMENTS_UPLOAD0Absns2012-04-01Authorpa adminComment50 Record MapFVascularCM
    my procedure:
    create or replace
    PROCEDURE PR_TEST_BLOB2 IS
    RES_BLOB CLOB;
    DEST_BLOB BLOB;
    SRC_BLOB BLOB;
    CURSOR CUR_TEST_BLOB2 IS
    SELECT REGEXP_SUBSTR(STR, '[^,]+', 1, LEVEL) FROM (SELECT UTL_RAW.CAST_TO_VARCHAR2(BLOB_VALUE) STR FROM TEST_BLOB2 WHERE TEST_ID=10)
    CONNECT BY LEVEL <= LENGTH(STR) - LENGTH(REPLACE(STR,','))+1;
    BEGIN
    OPEN CUR_TEST_BLOB2;
    LOOP
    FETCH CUR_TEST_BLOB2 INTO RES_BLOB;
    EXIT WHEN CUR_TEST_BLOB2%NOTFOUND;
    DBMS_OUTPUT.PUT_LINE(RES_BLOB);
    DEST_BLOB:=UTL_RAW.CAST_TO_RAW(RES_BLOB);--converting clob to blob;
    SELECT BLOB_VALUE INTO SRC_BLOB
    FROM TEST_BLOB2
    WHERE TEST_ID = 10 FOR UPDATE;
    --move the blob values to source file
    DBMS_LOB.APPEND(SRC_BLOB,DEST_BLOB);-- append the blob values
    COMMIT;
    END LOOP;
    CLOSE CUR_TEST_BLOB2;
    END;
    could you please help me.

  • SQL - Multiple Fetch into Single Column with Comma Separator

    Hello Experts,
    Good Day to all...
    I need your help on following scenarios. The below query returns set of titleID strings. Instead of printing them one below the other as query output, I want the output to be in batch of 25 values.i.e each row should have 25 values separated by comma. i.e If there are 100 titles satisfying the output, then there should be only four rows with and each row having 25 titles in comma separated manner.
    SELECT DISTINCT title_id
               FROM pack_relation
              WHERE package_id IN (      SELECT DISTINCT fa.package_id
                                                    FROM annotation fa
                                                GROUP BY fa.package_id
                                                  HAVING COUNT
                                                            (fa.package_id) <100);I tried with the PL/SQL block; whereas it is printing all the values continously :(
    I need to stop with 25 values and display.
    If its possible with SQL block alone; then it would be of great help
    DECLARE
       v_str   VARCHAR2 (32767)  := NULL;
       CURSOR c1
       IS
         SELECT DISTINCT title_id
               FROM pack_relation
              WHERE package_id IN (      SELECT DISTINCT fa.package_id
                                                    FROM annotation fa
                                                GROUP BY fa.package_id
                                                  HAVING COUNT
                                                            (fa.package_id) <100);
    BEGIN
       FOR i IN c1
       LOOP
          v_str := v_str || ',' || i.title_id;
       END LOOP;
       v_str := SUBSTR (v_str, 2);
       DBMS_OUTPUT.put_line (v_str);
    EXCEPTION
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.put_line ('Error-->' || SQLERRM);
    END;Thanks...

    You can use CEIL
    Sample code
    SELECT
        nt,
        LTRIM(MAX(SYS_CONNECT_BY_PATH(val,',')) KEEP (DENSE_RANK LAST ORDER BY curr),',') AS concat_val
    FROM
            SELECT
                val,
                nt,
                ROW_NUMBER() OVER (PARTITION BY nt ORDER BY val)    AS curr,
                ROW_NUMBER() OVER (PARTITION BY nt ORDER BY val) -1 AS prev
            FROM
                    SELECT
                        level                          AS val,
                        ceil(rownum/3)  as nt /* Grouped in batches of 3 */
                    FROM
                        dual
                        CONNECT BY level <= 10
    GROUP BY
        nt
        CONNECT BY prev = PRIOR curr
    AND nt              = PRIOR nt
        START WITH curr = 1;
            NT CONCAT_VAL
             1 1,2,3
             2 4,5,6
             3 7,8,9
             4 10Your code
    SELECT
        nt,
        LTRIM(MAX(SYS_CONNECT_BY_PATH(title_id,',')) KEEP (DENSE_RANK LAST ORDER BY curr),',') AS concat_val
    FROM
            SELECT
                title_id,
                nt,
                ROW_NUMBER () OVER (PARTITion BY nt ORDER BY title_id)   AS curr,
                ROW_NUMBER() OVER (PARTITION BY nt ORDER BY title_id) -1 AS prev
            FROM
                    SELECT
                        title_id,
                        ceil(rownum/25) AS nt /* Grouped in batches of 25 */
                    FROM
                        pack_relation tdpr
                    JOIN annotation fa
                    ON
                        tdpr.package_id = fa.package_id
                    GROUP BY
                        title_id,
                        fa.package_id
                    HAVING
                        COUNT (fa.package_id) < 500
    GROUP BY
        nt
        CONNECT BY prev = PRIOR curr
    AND nt              = PRIOR nt
        START WITH curr = 1;

  • How Can insert the records into Excel_sheet by using SQL Task-SSIS ?

    As per requirement ,
    insert the records in excel sheet(DT)  by using SQL Task-SSIS .
    I used SQL query in SQL Task-SSIS:
    e.g.., INSERT INTO [DT$B1:B1] VALUES ('COMMM')
    but error:Executing the query "INSERT INTO [DT$B1:B1] VALUES ('COMMM') " failed with the following error: "This table contains cells that are outside the range of cells defined in this spreadsheet.". Possible failure reasons: Problems
    with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
    Please any suggestion  ...
    -MADHU

    then first create a table inside Excel sheet based on your source data. You can Execute sql task for that using excel connection. then use insert to populate it
    see an example here where I create a dynamic sheet using execute sql task
    http://visakhm.blogspot.in/2013/09/exporting-sqlserver-data-to-multiple.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to change the angle into front perspective using smart object vectors

    Hello, I need this answered so i could succesfully do my school project.
    I was using a logo mock up vector(smart object file) for my illustration and was wondering if there is any way to present it in front perspective?
    This is just a sample image. I had created a brand new illustration not just a logo but the effect is same.
    As you can see the wood engraved logo is presented in an angle. Could i change the position of this sample logo into a front view or i have to make this effect myself from scratch?

    On your example i used the Perspective Crop Tool
    1. Draw out the perspective crop and move the corner handles to line up with the inside corners of the logo
        (blue circles)
    2. Then drag out the side handles just outside the image
    3. Press the checkmark button to complete the crop
    You said vector smart object.
    Is that logo something you created in illustrator?

  • Rows into single column with comma seperator

    Hi Friends,
    I have the following Query
    select A.tradeid||','||A.TICKER||'|'||A.SUBORDINATION||'|'||A.CUSIP||'|'||A.DOCCLAUSE||'|'||A.CURRENCY from table A
    where A.ticker in ('LYME','GAADF') and A.tradeid in('456777')
    which is returning
    456777,LYME|SENIOR UNSECURED|Z1700990|MM|USD
    456777,GAADF|SENIOR UNSECURED|Z1246790|MM|USD
    I want the result set as:
    456777,LYME|SENIOR UNSECURED|Z1700990|MM|USD,456777,GAADF|SENIOR UNSECURED|Z1246790|MM|USD
    Please help me to get the result set
    Thanks,
    ragu.
    Edited by: user533548 on Apr 3, 2009 12:54 AM
    Edited by: user533548 on Apr 3, 2009 12:55 AM

    you could do
    select max (ltrim (sys_connect_by_path (tradeid||'|'||TICKER||'|'||SUBORDINATION||'|'||CUSIP||'|'||DOCCLAUSE||'|'||CURRENCY, ','), ','))
      from (
    select tradeid
         , ticker
         , subordination
         , cusip
         , docclause
         , currency
         , row_number() over (partition by tradeid
                                  order by null
                             ) rn
      from x)
    start with rn = 1
    connect by rn = prior rn + 1like in
    SQL> with x as
      2  (
      3  select 456777 tradeid ,'LYOE' ticker ,'SENIOR UNSECURED' subordination,'Z1830990' cusip,'MM' docclause,'USD'  currency from dual union all
      4  select 456777 tradeid ,'GAZDF','SENIOR UNSECURED','Z8446790','MM','USD' from dual
      5  )
      6  select max (
      7        ltrim
      8        (sys_connect_by_path (tradeid||'|'||TICKER||'|'||SUBORDINATION||'|'||CUSIP||'|'||DOCCLAUSE||'|'||CURRENCY
      9         , ',')
    10        , ',')) str
    11    from (
    12  select tradeid
    13       , ticker
    14       , subordination
    15       , cusip
    16       , docclause
    17       , currency
    18       , row_number() over (partition by tradeid
    19                                order by null
    20                           ) rn
    21    from x)
    22   start with rn = 1
    23   connect by rn = prior rn + 1
    24 
    SQL> /
    STR
    456777|GAZDF|SENIOR UNSECURED|Z8446790|MM|USD,456777|LYOE|SENIOR UNSECURED|Z1830990|MM|USD

  • How to insert a very long string into a column of datatype 'LONG'

    Can anyone please tell me how can I insert a very long string into a column of datatype 'LONG'?
    I get the error, ORA-01704: string literal too long when I try to insert the value into the table.
    Since it is an old database, I cannot change the datatype of the column. And I see that the this column already contains strings which are very long.
    I know this can be done using bind variables but dont know how to use it in a simple query.
    Also is there any other way to do it?

    Hello,
    To preserve formatting in this forum, please enclose your code output between \ tags. And when executing you code as a pl/sql or sql script
    include following lineset define off;
         Your code or output goes here
      \Regards
    OrionNet                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to concatenate a string with single quotes

    Hi all,
        how to concatenate a string with single quotes to a variable.
    Sathya

    Hi sathyabama,
    1. simple
    2. use TILDE character <b>(`)</b>
       (just left to the '1' key)
    <b> `'mystring'`</b>
    3. just copy paste
    report abc.
    data : m(100) type c.
    concatenate `'amit mittal'` 'hello' into m separated  by space.
    write m.
    regards,
    amit m.

  • How to split the string by datetime in sql

    Hi,
    How to split the string by datetime in sql, I've a table with comments column stores comments by datetime, while selecting I want to split and show as in rows by each jobref.
    can anyone help me in this please.
    Thanks,

    declare @callcentre table (comments varchar(max),lbiref varchar(200))
    insert into @callcentre
    select '(28/10/2014 14:56:14) xyz ..... call  logged   (28/10/2014 14:56:58) xyz ..... call updated   (28/10/2014 14:57:41)xyz ..... call updated','Vi2910201'
    insert into @callcentre
    select '(29/10/2014 14:56:14) xyz ..... call  logged   (29/10/2014 14:56:58) xyz ..... call updated   (29/10/2014 14:57:41)xyz ..... call updated','Vi2910202'
    insert into @callcentre
    select '(30/10/2014 14:56:14) xyz ..... call  logged   (30/10/2014 14:56:58) xyz ..... call updated  
    output:
    1) 28/10/2014 14:56:14, (28/10/2014 14:56:14) xyz ..... call  logged ,'Vi2910201'
     2) 28/10/2014 14:56:58 ,(28/10/2014 14:56:58) xyz ..... call updated ,'Vi2910201'
    3) 28/10/2014 14:57:41,  (28/10/2014 14:57:41)xyz ..... call updated,'Vi2910201'
    4) 28/10/2014 14:56:14, (28/10/2014 14:56:14) xyz ..... call  logged ,'Vi2910202'
     5) 28/10/2014 14:56:58 ,(28/10/2014 14:56:58) xyz ..... call updated ,'Vi2910202'
    6) 28/10/2014 14:57:41,  (28/10/2014 14:57:41)xyz ..... call updated,'Vi2910202'
    7) 28/10/2014 14:56:14, (28/10/2014 14:56:14) xyz ..... call  logged ,'Vi2910203'
     8) 28/10/2014 14:56:58 ,(28/10/2014 14:56:58) xyz ..... call updated ,'Vi2910203'
    Thanks,
    See this illustration
    declare @callcentre table (comments varchar(max),lbiref varchar(200))
    insert into @callcentre
    select '(28/10/2014 14:56:14) xyz ..... call logged (28/10/2014 14:56:58) xyz ..... call updated (28/10/2014 14:57:41)xyz ..... call updated','Vi2910201'
    insert into @callcentre
    select '(29/10/2014 14:56:14) xyz ..... call logged (29/10/2014 14:56:58) xyz ..... call updated (29/10/2014 14:57:41)xyz ..... call updated','Vi2910202'
    insert into @callcentre
    select '(30/10/2014 14:56:14) xyz ..... call logged (30/10/2014 14:56:58) xyz ..... call updated','Vi2910203'
    SELECT LEFT(p.u.value('.[1]','varchar(max)'),CHARINDEX(')',p.u.value('.[1]','varchar(max)'))-1) AS [Date],
    '(' + p.u.value('.[1]','varchar(max)') AS comments,
    lbiref
    FROM
    SELECT lbiref,CAST('<Root>' + STUFF(REPLACE(comments,'(','</Data><Data>'),1,7,'') + '</Data></Root>' AS XML) AS x
    FROM @callcentre c
    )t
    CROSS APPLY x.nodes('/Root/Data')p(u)
    and the output
    Date comments lbiref
    28/10/2014 14:56:14 (28/10/2014 14:56:14) xyz ..... call logged Vi2910201
    28/10/2014 14:56:58 (28/10/2014 14:56:58) xyz ..... call updated Vi2910201
    28/10/2014 14:57:41 (28/10/2014 14:57:41)xyz ..... call updated Vi2910201
    29/10/2014 14:56:14 (29/10/2014 14:56:14) xyz ..... call logged Vi2910202
    29/10/2014 14:56:58 (29/10/2014 14:56:58) xyz ..... call updated Vi2910202
    29/10/2014 14:57:41 (29/10/2014 14:57:41)xyz ..... call updated Vi2910202
    30/10/2014 14:56:14 (30/10/2014 14:56:14) xyz ..... call logged Vi2910203
    30/10/2014 14:56:58 (30/10/2014 14:56:58) xyz ..... call updated Vi2910203
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to write a procedure to load the data into a table using xml file as input to the procedure?

    Hi,
    Iam new to the xml,
    can u please anyone help me how to write procedure to load the data into a table using xml as input parameter to a procedure and xml file is as shown below which is input to me.
    <?xml version="1.0"?>
    <DiseaseCodes>
    <Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    </DiseaseCodes>.
    Regards,
    vikram.

    here is the your XML parse in 11g :
    select *
      from xmltable('//Entity' passing xmltype
    '<?xml version="1.0"?>
    <DiseaseCodes>
    <Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    </DiseaseCodes>
    ') columns
      "dcode" varchar2(4000) path '/Entity/dcode',
      "ddesc" varchar2(4000) path '/Entity/ddesc',
      "reauthflag" varchar2(4000) path '/Entity/reauthflag'
    dcode                                                                            ddesc                                                                            reauthflag
    0                                                                                (I87)Other disorders of veins - postphlebitic syndrome                           0
    0                                                                                (J04)Acute laryngitis and tracheitis                                             0
    0                                                                                (J17*)Pneumonia in other diseases - whooping cough                               0
    SQL>
    Using this parser you can create procedure as
    SQL> create or replace procedure myXMLParse(x clob) as
      2  begin
      3    insert into MyXmlTable
      4      select *
      5        from xmltable('//Entity' passing xmltype(x) columns "dcode"
      6                      varchar2(4000) path '/Entity/dcode',
      7                      "ddesc" varchar2(4000) path '/Entity/ddesc',
      8                      "reauthflag" varchar2(4000) path '/Entity/reauthflag');
      9    commit;
    10  end;
    11 
    12  /
    Procedure created
    SQL>
    SQL>
    SQL> exec myXMLParse('<?xml version="1.0"?><DiseaseCodes><Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity></DiseaseCodes>');
    PL/SQL procedure successfully completed
    SQL> select * from MYXMLTABLE;
    dcode                                                                            ddesc                                                                            reauthflag
    0                                                                                (I87)Other disorders of veins - postphlebitic syndrome                           0
    0                                                                                (J04)Acute laryngitis and tracheitis                                             0
    0                                                                                (J17*)Pneumonia in other diseases - whooping cough                               0
    SQL>
    SQL>
    Ramin Hashimzade

  • I want to convert a series of names into a table (in either numbers or pages). The list I have has a name and then an email address in brackets, followed by a 'yes' or a 'no'. I would like to separate the list into three columns

    I want to convert a series of names into a table (in either numbers or pages). The list I have has a name and then an email address in brackets, followed by a 'yes' or a 'no'. I would like to separate the list into three columns - the first containing the name, the second containing the email address and the third containing the 'yes' or 'no'.
    Can you help me ?

    The question that needs to be answered is what is separating the columns? Is it a single tab, one or more tabs, spaces, or what?  Or is it the brackets that makes the separation between the three pieces of data?
    If it is always a single tab, that makes it really easy.  All you have to do is find/replace the brackets with nothing (as Wayne said)
    If it might be multiple tabs, you can find/replace tab-tab with a single tab and repeat that a few times until no more double-tabs are found.
    If it is one or multiple spaces, that might be difficult. I'll think about this one if this is what you have. I'll ignore this possiblility for now.
    If it is the brackets separating the three pieces of data, you would Find/Replace the left bracket with a tab then do the same with the right bracket.

  • Easy Question: How to split concatenated string into multiple rows?

    Hi folks,
    this might be an easy question.
    How can I split a concatenated string into multiple rows using SQL query?
    INPUT:
    select 'AAA,BBB,CC,DDDD' as data from dualDelimiter = ','
    Expected output:
    data
    AAA
    BBB
    CCC
    DDDDI'm looking for something kind of "an opposite for 'sys_connect_by_path'" function.
    Thanks,
    Tomas

    Here is the SUBSTR/INSTR version of the solution:
    SQL> WITH test_data AS
      2  (
      3          SELECT ',' || 'AAA,BBB,CC,DDDD' || ',' AS DATA FROM DUAL
      4  )
      5  SELECT  SUBSTR
      6          (
      7                  DATA
      8          ,       INSTR
      9                  (
    10                          DATA
    11                  ,       ','
    12                  ,       1
    13                  ,       LEVEL
    14                  ) + 1
    15          ,       INSTR
    16                  (
    17                          DATA
    18                  ,       ','
    19                  ,       1
    20                  ,       LEVEL + 1
    21                  ) -
    22                  INSTR
    23                  (
    24                          DATA
    25                  ,       ','
    26                  ,       1
    27                  ,       LEVEL
    28                  ) - 1
    29          )       AS NEW_STRING
    30  FROM    test_data
    31  CONNECT BY LEVEL <= LENGTH(REGEXP_REPLACE(DATA,'[^,]','')) - 1
    32  /
    NEW_STRING
    AAA
    BBB
    CC
    DDDD

Maybe you are looking for