title: DBMS_OUTPUT.PUT_LINE: Deciding how many tabs to put according to output length
body: <p>I have a procedure where a <code>CURSOR c1</code> is declared. Then I want to output columns in each role <code>c1</code> fetches.</p>
  
  <pre><code>FOR rec IN c1
      LOOP
        DBMS_OUTPUT.PUT_LINE (rec.branchno || CHR(9) || rec.street || CHR(9)
          || rec.city || CHR(9) || rec.postcode);
      END LOOP;
  </code></pre>
  
  <p>I'm now using <code>CHR(9)</code> to output exactly one tab. However, sometimes <code>rec.city</code> has more than 8 characters and thus a tab will push the following <code>postcode</code> right by one tab, as in the second line of output shown below .</p>
  
  <pre><code>B003    163 Main St.    Glasgow G11 9QX         
  B007    16 Argyll St.   Aberdeen    AB2 3SU 
  B005    22 Deer Rd.     London  SW1 4EH    
  </code></pre>
  
  <p>Is there a way to make <code>DBMS_OUTPUT</code> adjust the tabs automatically? For example, </p>
  
  <pre><code>IF STRLEN(rec.city) &lt; 8
      PUT ( CHR(9) || CHR(9) )
  ELSE
      PUT ( CHR(9) )
  END IF;
  </code></pre>
  
  <p>If no, what's the industry convention of generating such formatted output?</p>
  
  <p>Thank you for your help.</p>