   l_keyword               CLOB;
   l_stashed_comment       VARCHAR2(50);
   l_function              VARCHAR2(30);
-  l_bind_var              VARCHAR2(30);
-  l_var                   VARCHAR2(30);
-
+ 
   l_var_list              var_list_typ := i_var_list;
 
   l_table_owner           VARCHAR2(30);

  G_REGEX_ASSIGN_TO_VARS      CONSTANT VARCHAR2(50) :=  '\W\w+?\s*?:='; --matches on both G_REGEX_ASSIGN_TO_VAR and G_REGEX_ASSIGN_TO_BIND_VAR 
  G_REGEX_ASSIGN_TO_VAR       CONSTANT VARCHAR2(50) :=  '\s\w+?\s*?:=';
  G_REGEX_ASSIGN_TO_BIND_VAR  CONSTANT VARCHAR2(50) :=  ':\w+?\s*?:=';
  G_REGEX_VAR                 CONSTANT VARCHAR2(50) := G_REGEX_WORD;
  G_REGEX_REC_COL             CONSTANT VARCHAR2(50) := G_REGEX_WORD||'.'||G_REGEX_WORD;

  G_REGEX_BIND_VAR            CONSTANT VARCHAR2(50) := ':'||G_REGEX_WORD;
  G_REGEX_SHOW_ME_LINE        CONSTANT VARCHAR2(50) :=  '.+--(\@\@)';
  G_REGEX_ROW_COUNT_LINE      CONSTANT VARCHAR2(50) :=  '.+--(RC)';


  G_REGEX_DELETE              CONSTANT VARCHAR2(50) := '\sDELETE\s'        ;
  G_REGEX_INSERT_INTO         CONSTANT VARCHAR2(50) := '\sINSERT\s+?INTO\s';
  G_REGEX_UPDATE              CONSTANT VARCHAR2(50) := '\sUPDATE\s';
  
  G_REGEX_FETCH_INTO         CONSTANT VARCHAR2(50) := '\sFETCH\s+?.+?\s+?INTO\s';
 
 




  G_REGEX_DML                 CONSTANT VARCHAR2(200) :=   G_REGEX_DELETE_FROM 
                                                  ||'|'|| G_REGEX_DELETE
                                                  ||'|'|| G_REGEX_INSERT_INTO
                                                  ||'|'|| G_REGEX_UPDATE;



  PROCEDURE find_bind_var IS   
    -- find assignment of bind variable and inject a note    
    l_var                   VARCHAR2(30);
  BEGIN
    go_upto; 
    l_var := get_next ( i_search      => G_REGEX_BIND_VAR
                       ,i_lower       => TRUE
                       ,i_colour      => G_COLOUR_BIND_VAR);      
    go_past(G_REGEX_SEMI_COL); 
    
    inject( i_new_code   => 'ms_logger.note(l_node,'''||l_var||''','||l_var||');'
           ,i_indent     => i_indent
           ,i_colour     => G_COLOUR_NOTE);
  END;

 

  PROCEDURE find_non_bind_var IS
    -- find assignment of non-bind variable and inject a note
    l_var                   VARCHAR2(30);
  BEGIN
      go_upto;    
      l_var := get_next ( i_search      => G_REGEX_VAR
                         ,i_lower       => TRUE
                         ,i_colour      => G_COLOUR_VAR);
        ms_logger.note(l_node, 'l_var'     ,l_var  );                       
        go_past(G_REGEX_SEMI_COL);
    
        IF l_var_list.EXISTS(l_var) THEN
          --This variable exists in the list of scoped variables with compatible types    
          ms_logger.comment(l_node, 'Scoped Var');
          ms_logger.note(l_node,'l_var_list(l_var)',l_var_list(l_var));
          IF  REGEXP_LIKE(l_var_list(l_var) , G_REGEX_SUPPORTED_TYPES) THEN
            --Data type is supported.
            ms_logger.comment(l_node, 'Data type is supported');
            --So we can write a note for it.
            inject( i_new_code => 'ms_logger.note(l_node,'''||l_var||''','||l_var||');'
                 ,i_indent   => i_indent
                 ,i_colour   => G_COLOUR_NOTE); 
          ELSE
            ms_logger.comment(l_node, 'Data type is TABLE_NAME');
            --Data type is unsupported so it is the name of a table instead.
            --Now write a note for each supported column.
            ms_logger.comment(l_node, 'Data type is supported');
            --Also need to add 1 var def for each valid componant of the record type.
            l_table_owner := table_owner(i_table_name => l_var_list(l_var));
            FOR l_column IN 
              (select lower(column_name) column_name
                     ,data_type
               from all_tab_columns
               where table_name = l_var_list(l_var) 
               and   owner      = l_table_owner  ) LOOP

               IF  REGEXP_LIKE(l_column.data_type , G_REGEX_SUPPORTED_TYPES) THEN
               
                 ms_logger.note(l_node,'l_var.l_column.column_name',l_var||'.'||l_column.column_name);
             
                   inject( i_new_code => 'ms_logger.note(l_node,'''||l_var||'.'||l_column.column_name||''','||l_var||'.'||l_column.column_name||');'
                          ,i_indent   => i_indent
                          ,i_colour   => G_COLOUR_NOTE); 
               END IF;

            END LOOP;  
 
          END IF;

         
        END IF;
  END;

  PROCEDURE find_rec_col_var IS
  -- find assignment of rec.column variable and inject a note
    l_var                   VARCHAR2(30);
  BEGIN
 
        go_upto;    
        l_var := get_next( i_search      => G_REGEX_REC_COL
                          ,i_lower       => TRUE
                          ,i_colour      => G_COLOUR_VAR);
        ms_logger.note(l_node, 'l_var '     ,l_var  );                       
 
        go_past(G_REGEX_SEMI_COL); 
    
        IF l_var_list.EXISTS(l_var) THEN
          --Tab Column rec variable exists 
          ms_logger.note(l_node,'l_var',l_var);
          inject( i_new_code => 'ms_logger.note(l_node,'''||l_var||''','||l_var||');'
                 ,i_indent   => i_indent
                 ,i_colour   => G_COLOUR_NOTE);         
        END IF;
   END;

 

 
BEGIN

