title: Why this procedure does not work properly? INSTR and SUBSTR issues
body: <p>I made this procedure:</p>
  
  <pre><code>create or replace procedure calculate_vertices(vertices VARCHAR2) AS
      pos2 INTEGER;
      pos1 INTEGER := 1;
      posDash INTEGER;
      lat VARCHAR2(20);
      lon VARCHAR2(20);
  BEGIN
      loop
          pos2:=INSTR(vertices,'@',pos1);
          exit when pos2 = 0;
          posDash := INSTR (vertices,'-',pos1);
          lat := SUBSTR(vertices,pos1,pos2-(posDash+1));
          dbms_output.put_line(lat);
          lon := SUBSTR(vertices,posDash+1,pos2-(posDash+1));
          dbms_output.put_line(lon);
          pos1 := pos2+1;
      end loop;
  END;
  </code></pre>
  
  <p>then i called it as follows:</p>
  
  <pre><code>exec calculate_vertices('122.23-243.345@222.22-323@');
  </code></pre>
  
  <p>The result expected is:</p>
  
  <pre><code>122.23
  243.345
  222.22
  323
  </code></pre>
  
  <p>But the real output is:</p>
  
  <pre><code>122.23-
  243.345
  222
  323
  </code></pre>
  
  <p>How is it possible?</p>
  
  <p>EDIT: I noticed it put in the variable LAT the same number of characters of the variable LON. Why?</p>