title: How do I set LINESIZE and PAGESIZE with a substitution variable?
body: <p>I am trying to use a PL/SQL script in SQL*Plus to set the linesize and pagesize based on a developer input on whether a report should print in landscape or portrait orientation. If it is landscape, I want linesize 132 and pagesize 60. If it is portrait, I want 88 and 80 respectively.</p>
  
  <p>I am trying to use substitution variables to do so like this:</p>
  
  <pre><code>DEFINE PRINT_ORIENTATION 'PORTRAIT'
  
  COLUMN LINESIZE_VALUE NOPRINT new_value LINE
  COLUMN PAGESIZE_VALUE NOPRINT new_value PAGE
  
  SELECT DECODE('&amp;PRINT_ORIENTATION', 'PORTRAIT', 88, 'LANDSCAPE', 132) AS LINE,
         DECODE('&amp;PRINT_ORIENTATION', 'PORTRAIT', 80, 'LANDSCAPE', 60) AS PAGE
  FROM DUAL
  /
  
  SET LINESIZE &amp;LINE
  SET PAGESIZE &amp;PAGE
  </code></pre>
  
  <p>However, the system then just prompts me to manually enter values for line and page. What do I need to do to use a substitution variable in the SET command?</p>