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.
I am trying to use substitution variables to do so like this:
DEFINE PRINT_ORIENTATION 'PORTRAIT'
COLUMN LINESIZE_VALUE NOPRINT new_value LINE
COLUMN PAGESIZE_VALUE NOPRINT new_value PAGE
SELECT DECODE('&PRINT_ORIENTATION', 'PORTRAIT', 88, 'LANDSCAPE', 132) AS LINE,
DECODE('&PRINT_ORIENTATION', 'PORTRAIT', 80, 'LANDSCAPE', 60) AS PAGE
FROM DUAL
/
SET LINESIZE &LINE
SET PAGESIZE &PAGE
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?