Results 1 to 2 of 2
  1. #1
    Join Date
    May 2011
    Posts
    1

    Unanswered: how to split the string

    hi....
    In my table i have a field called swistmsg, which contains value as

    :201:0001OTT11000004|:23b1:CRED|:32a1:01-01-2011|:32a2:USD|:
    32a3:1000.|:33b1:USD(similarly around 100 rows)

    and my requirement is(when '|' operator comes split n comes down
    :201:0001OTT11000004
    :23b1:CRED
    :32a1:01-01-2011
    :32a2:USD
    32a3:1000
    :33b1:USD

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    In later versions of Oracle (10G on I believe) there is a package called APEX_UTIL (or HTMLDB_UTIL in some versions) that can be used in PL/SQL like this:

    Code:
    declare
       l_tab apex_application_global.vc_arr2;
    begin
       l_tab := apex_util.string_to_table(':201:0001OTT11000004|:23b1:CRED|:32a1:01-01-2011|:32a2:USD|:32a3:1000.|:33b1:USD',
                                          '|');
       for i in 1..l_tab.count loop
          dbms_output.put_line (l_tab(i));
       end loop;
    end;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •