Vai al contenuto

# MY_INSTR

## Codice Sorgente

    function my_instr( p_value   varchar2,
                                         p_delim   varchar2 )
    return number
    as

      i          number;

      l_length   number;

    begin

      if p_value is null then
        return null;
      end if;

      i := 1;

      l_length := length(p_value);

      for i in 1..l_length
      loop
        if substr(p_value, i, length(p_delim)) = p_delim then
          return i;
        end if;
      end loop;

      return 0;

    end;