How to append/modify a given string in pl/sql based on a delimiter

Hi,
I have a string for eg: 00600356,00015940,00022200
I would want to change it the following string
to_number(00600356),to_number(00015940),to_number(00022200)
Any ideas on how to do this.
Thanks!

Here is a one-line version that doesn't involve a loop:
sql>declare
  2    x  varchar2(255) := '00600356,00015940,00022200';
  3  begin
  4    x := substr(replace(',' || x || ')', ',', '),to_number('), 3);
  5    dbms_output.put_line( x );
  6  end;
  7  /
to_number(00600356),to_number(00015940),to_number(00022200)
PL/SQL procedure successfully completed.And, if by chance you want the entries delimited with single quotes:
sql>declare
  2    x  varchar2(255) := '00600356,00015940,00022200';
  3  begin
  4    x := substr(replace(',' || x || ''')', ',', '''),to_number('''), 4);
  5    dbms_output.put_line( x );
  6  end;
  7  /
to_number('00600356'),to_number('00015940'),to_number('00022200')
PL/SQL procedure successfully completed.

Similar Messages

  • How to append the User Agent String in IE11

    We use "Internet Explorer maintenance" GPO to append the standard User Agent String for IE9 with "ADFSIntAuth". "Internet Explorer maintenance" is deprecated and will not work anymore for IE11 and later.
    Now we want to move to IE11 and I can't find a solution to append the User Agent String. With GPO this isn't possible anymore (Why Microsoft?). And the registry keys I've tested won't do the job. I've tested 
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\User Agent
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform
    So whats is the best way to append the user agent string for IE11?
    http://social.technet.microsoft.com/Forums/en-US/cdc999aa-faec-4aa5-9025-f12a524794f0/ie10-user-agent-string?forum=winserverGP didn't help.

    Thank you for the Reply Roger.
    I have already read the website you are referring to, but it doesn't say how to append the User Agent String.
    Only this:
    "Earlier versions of the browser included
    Pre-Platform and Post-platform registry value tokens in the user-agent string. However, this led to
    performance issues for customers of certain tools and add-ons. As a result, these tokens are now reported only through the
    navigator.userAgent property"
    With a dead link to the article "navigator.userAgent", but with a search I came to this article: http://msdn.microsoft.com/en-us/library/ie/ms534712(v=vs.85).aspx But also this article won't say how to append the User Agent String for all
    clients in a corporate environment.

  • How do I modify the WHERE clause in my SQL query?

    This seems like such a straight-forward part of the report design, but I'm fairly new to Crystal Reports and I only have experience with modifying reports someone else has already written.  In this particular case, I just need to modify the WHERE clause of the SQL query.  I can select Show SQL Query and see what statement is being used to select data, but I can't find where to modify it since it's grayed out.  I see how to change the selection criteria, parameters, grouping, etc...just not the WHERE clause.  The report is linked to a database used for reporting with a table created and populated by a stored procedure.  I don't need to modify the stored procedure because the data I want to filter by is currently in the table--I just don't know how to filter by what I need.  Here's part of the query:
    SELECT "rpt_dist"."startdate", "rpt_dist"."transtype", "rpt_dist"."laborcode", "rpt_dist"."crewid", "rpt_dist"."regularhrs" FROM   "Reporting"."dbo"."rpt_dist" "rpt_dist"
    WHERE  (rpt_dist."transtype" <> 'WORK' AND rpt_dist."transtype" <> 'WMATL') AND rpt_dist."laborcode" LIKE 'S%' AND (rpt_dist."crewid" = 'HOUS' OR rpt_dist."crewid" = 'HOUS2' ...
    I would like to add another crewid to the WHERE clause.  Thanks for any input.

    1.Open the report in the crystal designer
    2.Go to the field explorer(if hidden go to view menu->field explorer)
    3.Rt. click on the database fields->choose database expert
    4.Now you will see 2 columns-Available DataSource  and Selected Tables
    5.Rt. click on the object(ex.command) available in the Selected Tables column->Choose Edit command
    6.A new Modify Command window will appear,here you can edit your SQL Query
    I get to step 4 and I see the two columns including my database and the report table, but there is no command object available.  If I right-click on my table, I can just view the Properties. ??
    As for the other tip to modify the record selection:  I don't see anywhere the other crewid values are set and if I add the one I'm missing, it doesn't modify the existing SQL Query and when I preview the report it throws off the results so that no data displays??
    I'm using Crystal Reports 11.5 if that makes a difference.  Thanks again.

  • Simple Java Question - How to test if a given string is numeric or not

    Hi Experts,
    I have written one Java program. It fetches user ID from UME. The code is as below:
    Iterator itr = role.getUserMembers(true);
    while (itr.hasNext()) {
    String uniqId = (String) itr.next();
    IUser thisUser = myUserFactory.getUser(uniqId);
    wdComponentAPI.getMessageManager().reportSuccess("here "+thisUser.getUid() );
    Used ID is thisUser.getUid() . I have to find out all user IDs which are numeric.
    Do we have any standard Java program (API) to find out whether thisUser.getUid()  is numeric or not.
    Regards,
    Gary

    Hi
    Just try to parse this string to integer or long number and catch the NumberFormatException.
    Somthing like:
    try
       Integer.parseInt(userIdString);
    catch(NumberFormatException e)
      //do sume thing when user id is not number
    good luck

  • How to evaluate the dynamic condition string in PL/SQL ?

    Hello, I am solving the issue of checking and validating the event table.
    For Example, the event table namely "Contract_validated" contains some atts about a contract as follow:
    CONTRACT_VALIDATED (SEQ_ID, CO_ID, VALID_T, CHANGE_KEY, ATT1, ATT1_FROM, ATT2, ATT2_FROM, REASON, CHANGE_KEY_ORIG, ATT1_ORIG, ATT2_ORIG)
    In this table, the pairs (ATT1 and ATT1_FROM), (ATT2 and ATT2_FROM) must be compared to check whether the values are changed or not in the update event (change_key = U). If some records have change_key = U but the values does not change, I need to protocol and correct such records.
    The table name and attributes list could be dynamic, and will be provided as parameters. Therefore, I use Dynamic PL/SQL to generate the code to test the conditions between the values between the pairs columns for detecting the invalid event. However, I am stucking in testing the condition phrases because I can not evaluate the condition string in the SELECT statement. I can not use IF because parts of this condition string take the value from a record and collection type. Anyone has the idea how to evaluate the condition in such case, please give me instructions or recommendations (it could be other alternatives to solve the problems)
    Here is the code which generated from my Dynamic PL/SQL string, however, Oracle raise exception error at the EXECUTE IMMEDIATE v_sql command
    SELECT 'x' FROM DUAL WHERE (NVL(v_rec.ATT1, NULL) <> NVL(v_rec.ATT1_FROM , NULL) OR (NVL(v_rec.ATT2, NULL) <> NVL(v_rec.ATT2_FROM , NULL))
    E-0008: Unkown Exception raised in Loop. ORACLE:ORA-00904: "V_REC"."ATT2_FROM": invalid identifier
    vo_traced_list has type Table of VARCHAR2(2000), storing the atts list of table (CONTRACT_VALIDATED), it has value already from other procedure invocation.
    Here is the dynmic PL/SQL code generated dynamically depends on the table name, and attr list:
    DECLARE v_rec CONTRACT_VALIDATED%ROWTYPE;
    TYPE cv_type IS REF CURSOR;
    v_rec_cv CV_TYPE;
    v_cond VARCHAR2(4000);
    cond BOOLEAN := FALSE;
    v_exec VARCHAR2(1000);
    v_default VARCHAR2(10):= 'NULL';
    tk_val CONTRACT_VALIDATED.VALID_T%TYPE;
    pk_val CONTRACT_VALIDATED.CO_ID%TYPE;
    v_cnt NUMBER;
    BEGIN
    OPEN v_rec_cv FOR SELECT /*+ parallel(x,4) */ x.* FROM CONTRACT_VALIDATED x WHERE CHANGE_KEY = 'U' ORDER BY VALID_T;
    FETCH v_rec_cv INTO v_rec;
    IF v_rec_cv%NOTFOUND THEN
    Add_Log('Event_Validating',v_user,v_event_validated,'INFO','I-0001: No-Procession needed');
    ELSE
    BEGIN
    LOOP
    pk_val := v_rec.co_id;
    tk_val := v_rec.valid_t;
    v_cnt := vo_traced_atts_list.COUNT;
    v_cond := '(NVL(v_rec.'|| vo_traced_atts_list(1)||', ' || v_default || ') <> NVL(v_rec.' || vo_traced_atts_list(1)||'_FROM'
    ||' , ' || v_default || '))';
    cond := (BOOLEAN) v_cond;
    FOR v_i IN 2..v_cnt LOOP
    BEGIN
    v_cond := v_cond ||CHR(13)||CHR(10)||'OR (NVL(v_rec.'||vo_traced_atts_list(v_i)||', ' || v_default || ') <> NVL(v_rec.'||vo_traced_atts_list(v_i)||'_FROM'
    ||' , ' || v_default || '))';
    END;
    END LOOP;
    v_exec := 'SELECT ''x'' FROM DUAL WHERE '||v_cond;
    Add_Log('Event_Validating',v_user,v_event_validated,'INFO',v_exec);
    EXECUTE IMMEDIATE v_exec;
    /* Exception raised from here
    E-0008: Unkown Exception raised in Loop. ORACLE:ORA-00904: "V_REC"."ATT2_FROM": invalid identifier
    It seems that Oracle does not understand the dynamic reference v_rec.ATT2_FROM, v_rec.ATT2,... to test the condtion
    IF SQL%ROWCOUNT = 0     THEN -- condition is false ==> traced attributes does not changed
    -- update the REASON = 4 - not interested event
    v_exec := 'UPDATE CONTRACT_VALIDATED SET REASON = 4 WHERE CO_ID = '||pk_val||' AND VALID_T = '||tk_val;
    EXECUTE IMMEDIATE v_exec;
    END IF;
    FETCH v_rec_cv INTO v_rec;
    EXIT WHEN v_rec_cv%NOTFOUND;
    END LOOP;
    EXCEPTION
    WHEN OTHERS THEN
    Add_Log('SCD_VALIDATION',v_user,v_event_validated,'ERROR','E-0008: Unkown Exception raised in Loop. ORACLE:'||SQLERRM);
    RAISE ge_raise_error;
    END;
    END IF;
    CLOSE v_rec_cv;
    EXCEPTION
    WHEN OTHERS THEN
    Add_Log('SCD_VALIDATION',v_user,v_event_validated,'ERROR','E-0008: Unkown Exception raised in Loop. ORACLE:'||SQLERRM);
    RAISE ge_raise_error;
    END;

    Dear Andrew,
    Thank you so much for your suggestions, however, I think it will be better to let me explain more about the situation.
    I am working at Data Warehousing and Analysis part. The event tables are provided by other applications such as Customer OTLP system, Sales Management, etc. We therefore just have the results stored in the event tables (which could be wrong or inconsistency) and no way to force them to be valid by constraints. Before further processing the events , their records should be checked and overridden if possible, and that is the point I am trying to solve now.
    The Event table names, their attributes list, data types, primary key, timestamp columns etc are dynamic and are provided via parameters. I would like to write a procedure which can check the invalid events (not only update, but also insert, delete), protocol them, and override them if possible before processing further. Because the table name, attribute lists, data type, etc are not known in advanced, to my best knowledge, the only choice is generating dynamic PL/SQL code although it could suck the performance. The code you have seen in my first question is the output from the follwoing procedure, where the i_att_list provides the atts list has been parsed from other procedure invocation, i_pk is the primary key, i_tk is the time key, i_table_name is the table name (which is Event_Validation in previous example). The stucking point I have met now is that I do not know how to test the condition to detect the different between column pairs (ATT1 and ATT1_FROM, ...). Using Select from dual is just a dummy select for testing the where condition which must be formed as a string by that way.
    Thank you very much for your answer and looking forward to seeing your further recommendations or suggestions.
    Regards,
    Tho.
    CREATE OR REPLACE PROCEDURE Update_Validation
    ( i_att_list enum_string, -- list of attributes
    i_pk IN VARCHAR2, -- primary key column
    i_tk IN VARCHAR2, -- time key column
    i_table_name IN VARCHAR2 -- table_name - the columns format be checked
    ) AUTHID Current_User IS
    TYPE LoopCurType           IS REF CURSOR;
    ln_parallel NUMBER := 4;
    ge_raise_error EXCEPTION;
    v_user VARCHAR2(100);
    v_sql VARCHAR2(4000);
    v_string VARCHAR2(4000);
    v_crlf VARCHAR2(2) := CHR(13)||CHR(10);
    BEGIN
    SELECT sys_context('USERENV','current_schema') INTO v_user FROM DUAL;
    v_sql:= 'SELECT /*+ parallel(x,'||ln_parallel||') */ x.* FROM ' ||i_table_name|| ' x '||
              'WHERE CHANGE_KEY = ''U'''||
    ' order by '||i_tk;
    v_string := 'DECLARE v_rec '||i_table_name||'%ROWTYPE;' ||v_crlf||
              ' TYPE cv_type IS REF CURSOR; ' ||v_crlf||
    ' v_rec_cv CV_TYPE; ' ||v_crlf||
              ' v_cond VARCHAR2(4000); ' ||v_crlf||
         ' v_exec VARCHAR2(100);' ||v_crlf||
              ' v_default VARCHAR2(10):= ''~~''; ' ||v_crlf||
    ' tk_val '||i_table_name||'.'||i_tk||'.%TYPE;'||v_crlf||
    ' pk_val '||i_table_name||'.'||i_pk||'.%TYPE;'||v_crlf||
              ' v_cnt NUMBER;' ||v_crlf||
              'BEGIN ' ||v_crlf||
                        'OPEN v_rec_cv FOR ' ||v_sql ||';' ||v_crlf||
                        'FETCH v_rec_cv INTO v_rec;' ||v_crlf||
                             ' IF v_rec_cv%NOTFOUND THEN ' ||v_crlf||
                                  'Add_Log(''Event_Validating'',v_user,i_table_name,''INFO'',''I-0001: No-Procession needed'');'||v_crlf||
                             ' ELSE ' ||v_crlf||
                                  ' BEGIN '||v_crlf||
                                  ' LOOP '||v_crlf||
                                  'pk_val := v_rec.'||i_pk||';'||v_crlf||
    'tk_val := v_rec.'||i_tk||';'||v_crlf||
    'v_cnt := i_att_list.COUNT;' ||v_crlf||
                                            'v_cond := ''NVL(v_rec.''|| i_att_list(1)||'', '' || v_default || '') <> NVL(v_rec.'' || i_att_list(1)||''_FROM'''||v_crlf||
                             '||'' , '' || v_default || '')'';'||v_crlf||
                                            'FOR v_i IN 2..v_cnt LOOP'||v_crlf||
                                                 'BEGIN'||v_crlf||
                                                 'v_cond := v_cond ||CHR(13)||CHR(10)||''OR NVL(v_rec.''||i_att_list(v_i)||''), <> NVL(v_rec.''||i_att_list(v_i)||''_FROM'''||v_crlf||
                                                 '||'' , '' || v_default || '')'';'||v_crlf||
                                                 'END;'||v_crlf||
                                            'END LOOP;'||v_crlf||
                                            'v_exec := ''SELECT ''x'' FROM DUAL WHERE ''||v_cond;'||v_crlf||
                                            'EXECUTE IMMEDIATE v_exec;'||v_crlf||
                                            'IF SQL%ROWCOUNT = 0     THEN -- condition is false ==> traced attributes does not changed'||v_crlf||
                                            '-- update the REASON = 4 - not interested event'||v_crlf||
                                            'UPDATE '||i_table_name||' SET REASON = 4 WHERE '||i_pk||' = '||v_tk||' AND '||i_tk||' = '||tk_val||';'||v_crlf||
                                            'END IF;'||v_crlf||
                                       'FETCH v_rec_cv INTO v_rec;' ||v_crlf||
                                       'EXIT WHEN v_rec_cv%NOTFOUND;'||v_crlf||
                        ' END LOOP;'||v_crlf||
                                  'EXCEPTION' ||v_crlf||
                             'WHEN OTHERS THEN'||v_crlf||
                        'Add_Log(''SCD_VALIDATION'',v_user,i_table_name,''ERROR'',''E-0008: Unkown Exception raised in Loop. ORACLE:''||SQLERRM);'||v_crlf||
                        'RAISE ge_raise_error;'||v_crlf||
                                  'END;'||v_crlf||
                                  'END IF;'|| v_crlf||
                        'Close v_rec_cv;'||v_crlf||
                        'EXCEPTION' ||v_crlf||
                   'WHEN OTHERS THEN'||v_crlf||
              'Add_Log(''SCD_VALIDATION'',v_user,i_table_name,''ERROR'',''E-0008: Unkown Exception raised in Loop. ORACLE:''||SQLERRM);'||v_crlf||
              'RAISE ge_raise_error;'||v_crlf||
                   'END;';               
         Add_Log('SCD_UPDATE_VALIDATION',v_user,i_table_name,'INFO','I-0006: Update Validation : '||v_string);     
         EXECUTE IMMEDIATE v_string;
    EXCEPTION
    WHEN OTHERS THEN
    Add_Log('SCD_VALIDATION',v_user,i_table_name,'ERROR','E-0008: Unkown Exception raised in Loop. ORACLE:'||SQLERRM);
    END Update_Validation;

  • How do I modify a user-defined function in SQL Plus

    I have created some functions in my database. Can anybody tell me how to modify/edit those functions?

    PS C:\> $Class2 = New-Object MyTest.Class1
    PS C:\> $Class2
    MyString Struct1Property Struct2Property
    MyTest.Struct1 MyTest.Class1+Struct2
    PS C:\> $Struct2 = New-Object MyTest.Class1+Struct2
    PS C:\> $Struct2.Property = "X"
    PS C:\> $Struct2
    Property
    X
    PS C:\> $Class2.Struct2Property = $Struct2
    PS C:\> $Class2.Struct2Property.Property
    XPS C:\> $Struct2.GetType()
    IsPublic IsSerial Name                                     BaseType                                                                    
    False    False    Struct2                                  System.ValueType                                                            
    Struct2 is a valuetype, (by value)
    The classes are by reference
    PS C:\> $Struct3 = $Class2.Struct2Property
    PS C:\> $Struct3
    Property
    X
    PS C:\> $Struct3.Property = "Y"
    PS C:\> $Class2.Struct2Property.Property
    X
    PS C:\> $Class2.MyString = "A"
    PS C:\> $Class3 = $Class2
    PS C:\> $Class3.MyString = "B"
    PS C:\> $Class2.MyString
    B

  • How to add a dynamic where clause for a sql based VO with group by query?

    Hi,
    Here is my case, I have a sql query based VO with the query like "select status, count(*) StatusCount from my_table group by status". Now I used the following java code trying to dynamically add the where clause to my VO to filter the rows based the type attribute in my DB table.
    vo.setWhereClause("type='MyType1' ");
    vo.executeQuery();
    Then I got the sql syntax error. Looks like the ADF has added the where clause to the end of my sql so my sql becomes "select status, count(*) StatusCount from my_table group by status where type='MyType1' ". But what I expected was the correct syntax "select status, count(*) StatusCount from my_table where type='MyType1' group by status".
    Does anyone know if this is an ADF bug? Or is there any other way to achieve my goal?
    Thanks,
    Chunyang
    Edited by: Chunyang on Dec 13, 2012 9:09 PM

    Hi,
    When you use setWhereClause on the VO, it is applied on top of the VO query. I.e, assume your VO has the following query.
    select empno, ename from empNow, if you apply the where clause programatically, only the two attributes that you are using in the select statement could be used. I.e
    select * from (select empno, ename from emp) where ename='KING' - VALID
    select * from (select empno, ename from emp) where deptno=10  - INVALID (because the inner query - the one you've defined as query for your vo does not have deptno attribute selected)If you would need to set a dynamic where clause, you need to make them available in your select statement / use bind variables.
    -Arun

  • How to append?

    How to append "?
    For example:
    String data="EE101";
    String data1=null;
    I want data1 to be: This is "EE101".
    I tried this method:
    data1="This is" + """ data""";
    But it does not work.
    So how to append " ?
    Thanks

    data1="This is \"" +data+"\"";

  • How to find out no. of occurrences of a sting in a given string

    Hi all,
    How do I find out the no. of occurrences of a sting in a given string.
    Your help would be appreciated.
    Thank you,
    Srinivas

    user636994 wrote:
    calculating no. of occurance of a string
    declare
    str1 varchar2(100) :='string';
    str2 varchar2(1000) := 'This is the string where all the string are placed. This pl/sql is used to search the accurance of a string into an another string';
    begin
    dbms_output.put_line(length(str2) - length(replace(str2,str1,substr(str1,1,length(str1)-1))));
    end;
    /A slightly shorter (in length) version of that would be...
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2  str1 varchar2(100) :='string';
      3  str2 varchar2(1000) := 'This is the string where all the string are placed. This pl/sql is used to search the accurance of a string into an another string';
      4  begin
      5  --dbms_output.put_line(length(str2) - length(replace(str2,str1,substr(str1,1,length(str1)-1))));
      6    dbms_output.put_line((length(str2) - length(replace(str2,str1)))/length(str1));
      7* end;
    SQL> /
    4
    PL/SQL procedure successfully completed.
    SQL>

  • How to search for perticular substring in given string.

    Hi, Can any one tell me how to search for perticular substring in given string.
    example:
    I have to search for CA in given Order type it may be CA10 or CA15. Please Do the needful.

    Hi Aniruddha,
    check this...
    Data var string,
    var = 'India'.
    search var for 'Ind'.
    if sy-subrc = 0.    " var having ind
    Message 'Ind found' type 'I'.
    else  .            "var not having ind
    Message 'Ind not Found' type 'I'.
    endif.
    thanx
    bgan.

  • How can I search the tree with a given string?

    How can I search the tree with a given string?
    I don't find any function like "search(...)".
    I want to find the tree nodes which include the given string.
    Thanks.

    Try it with .com instead of .ca - fixes it for me (corporate firewall blocks .ca here)
    http://spendolini.blogspot.com/2013/09/working-with-apex-tree.html
    Anyway - it links to an article of mine which describes interacting with the tree: Tom's Blog: Working with the tree in Apex. There is also a demo application on apex.oracle.com: http://apex.oracle.com/pls/apex/f?p=54687:38

  • How to find no of numeric characters in a given string ???

    How to find no of numeric characters in a given string ???
    Thanks,
    Kathir

    sabre150 wrote:
    Use String.replaceAll() to replace any characters that are not numeric and then take the length of the resultant String....and this might be useful: [http://www.regular-expressions.info/]
    ;-)

  • How t ocheck if given String is in uppercase or lowercase????

    how t ocheck if given String is in uppercase or lowercase????

    You could compare the result of string.toUpperCase() to the string itself. If it was uppercase already, the 2 strings would be the same. I'll leave it up to you to work out how to check if it's lower case :-)

  • How do count the character in the given string?

    hi all,
    i have astring like 'AAAARAMARAOAAA'.
    i want count how many 'A's in this string using sql statement.

    Is that a joke? You asked that in a previous thread of yours: how do count how many 'A' s in this string using sql stmt?.
    C.

  • Ref Cursor - How to append records into ref cursor?

    Hi,
    Is it possible to append ref cursor?
    Iam having a procedure which accepts 1 string as input
    parameter. That string will have list of ID delimited by comma.
    I want to extract & match every ID with some tables.
    My problem is for first ID i would get 10 records
    and for 2nd ID i 'l get other 20 records. But while returning
    i need to send the same(10 + 20 records) as ref cursor(OUT parameter).
    But in below given code i could send only last 20 records. first
    10 records are not append/updated into ref cursor.
    How to append 2nd 20 records with 1st 10 records? so that i can
    send all the 30 records.
    Here goes my code...
    CREATE OR REPLACE PROCEDURE getCRMGroupsAndRollups_PRC
    in_groupId IN VARCHAR2,
    out_getCRMGroups OUT TYPES.DATASET
    IS
    v_temp VARCHAR2(500) := in_groupId ||',';
    v_temp_split VARCHAR2(500);
    v_pos1 NUMBER := 0;
    v_pos2 NUMBER := 1;
    v_pos3 NUMBER := 0;
    v_extract_char VARCHAR(1) := NULL;
    v_comma_cnt NUMBER := 0;
    BEGIN
    -- check in for null input parameters
    IF ( in_groupId IS NOT NULL ) THEN
    -- loop to count no of in_groupId
    FOR j IN 1..LENGTH(v_temp)
    LOOP
         v_extract_char := SUBSTR(v_temp,j,1);
         IF (v_extract_char = ',') THEN
              v_comma_cnt := v_comma_cnt + 1;
         END IF;     
    END LOOP;
    -- loop to extract in_group Id
    FOR i IN 1..v_comma_cnt
    LOOP
         v_pos1 := instr(v_temp,',',(v_pos1 + 1));
         v_pos3 := ((v_pos1-1) - v_pos2 )+ 1;
         v_temp_split := SUBSTR(v_temp,v_pos2,v_pos3);
         v_pos2 := v_pos1 + 1;
    -- query to return dataset filled BY list of all the current
    -- CRM groups and the associated rollup groups
    OPEN out_getCRMGroups FOR
    SELECT
    DISTINCT
    gcs.crm_st_id_cd,
    gcs.lgcy_roll_up_grp_num,
    gcs.lgcy_roll_up_grp_name,
    gcs.grp_xwalk_complt_dt,
    gcs.crm_grp_num,
    gcs.facets_gnat_id,
    gcs.crm_grp_name
    FROM
    grp_convsn_stat gcs
    --lgcy_xref_elem lxe
    WHERE
    ( gcs.mbrshp_convsn_aprvl_dt = NULL )
    OR ( gcs.mbrshp_convsn_aprvl_dt < (SYSDATE - 7 ) )
    AND ( gcs.facets_grp_stat_actv_ind = 'Y' )
    AND ( gcs.lgcy_roll_up_grp_num = v_temp_split );
    END LOOP;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('INTERNAL ERROR');
    END getCRMGroupsAndRollups_PRC;
    in this v_temp_split will have extracted id & iam opening
    ref cursor for each & every ID extracted from list.
    2) How to handle no_data_found exception for this ref cursor?
    Please help me....
    -thiyagarajan.

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:110612348061
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425
    Message was edited by:
    Kamal Kishore

Maybe you are looking for