title: Oracle procedure giving different ASCII outputs
body: <p>This procedure prints the <code>ASCII</code> code for each character in a string.</p>
  
  <p>If executed in TOAD, it prints these ASCII codes: <code>55 48 48 32 32 32 32 32 32 32 49</code> which are the right ones.</p>
  
  <p>If executed via <code>SQLPLUS</code> on the <code>UNIX</code> server and spool the output of the <code>DBMS_OUTPUT.PUT_LINE (v_String);</code> to a text file, copy that output and assign it to the  v_String and execute the procedure in TOAD, I get the following <code>ASCII</code> codes <code>55 48 48 9 32 32 49</code>.</p>
  
  <p>Why it is replacing 32 32 32 32 32 with 9. Essentially a tab.</p>
  
  <pre><code>CREATE OR REPLACE PROCEDURE My_Test
  AS
     v_String   VARCHAR2 (25);
  BEGIN
     v_String := RPAD ('700', 10) || '1';
     -- v_String:='700   1';
     DBMS_OUTPUT.PUT_LINE (v_String);
     DBMS_OUTPUT.PUT_LINE ('');
  
     FOR i IN 1 .. LENGTH (v_String)
     LOOP
        DBMS_OUTPUT.PUT_LINE (ASCII (SUBSTR (v_String, i, 1)));
     END LOOP;
  EXCEPTION
     WHEN OTHERS
     THEN
        DBMS_OUTPUT.PUT_LINE (SQLERRM);
  END;
  </code></pre>