Databases Reference
In-Depth Information
As you may have noticed, Janice is somewhat of a perfectionist, and she thinks
that the report would look even better if the report header contained the list of
departments in the report. This gives Janice a good opportunity to use the double
ampersand in her substitution variable, so that she will not need to enter the depart-
ment list twice when she runs the script. Her revised script now looks like this:
set feedback off
ttitle left -
'Department Salary Report, Departments: &&DeptList'
btitle left 'End Salary Report' skip 1 -
left 'Widgets-R-Us, Inc.'
column Dept heading 'Dept|Number'
column salary format $999,999.99
break on Dept on Report
compute sum label 'Dept Total' -
of salary on Dept
compute sum label 'All Depts' -
of salary on Report
select department_id "Dept",
last_name || ', ' || first_name "Employee",
salary "Salary" from employees
where department_id in (&DeptList)
order by department_id asc, salary desc;
She changed the TTITLE command to include the substitution variable
&&DeptList. When this script is run, the prompt for DeptList occurs only once.
Search WWH ::




Custom Search