title: Not getting the correct output through procedure execution
body: <p>I am writing one recursive procedure for the below table(sample_table):
  Consider each column has varchar2 datatype:</p>
  
  <pre><code>PARENT_DATA CHILD_DATA  PARENT_VERSION  CHILD_VERSION
  ----------------------------------------------------------------
  20-10       40-01       -A11            -A11
  20-10       40-02       -A11            -A11
  20-10       40-03       -A11            -A11
  20-10       80-10       -A11            -A11
  20-10       81-10       -A11            -A11
  80-10       40-100      -A11            -A11
  80-10       40-101      -A11            -A11
  80-10       40-102      -A11            -A11
  </code></pre>
  
  <p>I need to write a recursive procedure such that for the given PARENT_DATA, if CHILD_DATA starts with '40' then it will be printed.
  If the CHILD_DATA starts with '80' then the procedure will be called recursively. 
  The final output will be as shown below:</p>
  
  <pre><code>PARENT_DATA CHILD_DATA PARENT_VERSION CHILD_VERSION
  ---------------------------------------------------
  20-10       40-01       -A11        -A11
  20-10       40-02       -A11        -A11
  20-10       40-03       -A11        -A11
  80-10       40-100      -A11        -A11
  80-10       40-101      -A11        -A11
  80-10       40-102      -A11        -A11
  </code></pre>
  
  <p>I have tried with the recursive procedure call with cursor:</p>
  
  <p>This is the code:</p>
  
  <pre><code>create or replace procedure proc_repeat(in_parent         in  varchar2,
                                          IN_VERSION        IN  VARCHAR2,
                                          out_child         out varchar2,
                                          OUT_CHILD_VERSION OUT VARCHAR2)
  as
    v_parent_Data varchar2(50);
    v_data varchar2(50);
    v_data_VERSION varchar2(50);
    v_data_RECUR varchar2(50);
    v_data_RECUR_VERSION varchar2(50);
  
    cursor cur_data is 
      select parent_data,child_data,child_version
        from sample_table
        where parent_data = in_parent AND
              parent_version = IN_VERSION;
  begin
    open cur_data;
    loop
      fetch cur_data
        into v_parent_Data,v_data,v_data_VERSION;
  
      exit when cur_data%notfound;
  
      IF V_DATA LIKE '40-%' THEN
        OUT_CHILD:=V_DATA;
        OUT_CHILD_VERSION:=v_data_VERSION;
      ELSIF V_DATA LIKE '80-%' THEN
        v_data_RECUR:=V_DATA;
        v_data_RECUR_VERSION:=v_data_VERSION;
  
        proc_repeat(v_data_RECUR, v_data_RECUR_VERSION,
                    out_child, OUT_CHILD_VERSION);
      END IF;
    end loop;
  
    close cur_Data;
  end;
  </code></pre>
  
  <p>The expected result is:</p>
  
  <pre><code>CHILD_DATA
  -----------
  40-01
  40-02
  40-03
  40-100
  40-101
  40-102
  </code></pre>
  
  <p>But I am getting only '40-102'</p>
  
  <pre><code>DECLARE
    A VARCHAR2(50):='20-10';
    B VARCHAR2(50):='-A11';
    C VARCHAR2(50);
    D VARCHAR2(50);
  BEGIN
    proc_repeat(A,B,C,D);
    DBMS_OUTPUT.PUT_LINE(C);
  END;
  </code></pre>