saketbansal
IS-IT--Management
- Jul 2, 2003
- 41
Hi,
The problem is in MASTER_DEATIL report in SQL
I have the value of job column in variable job_var. Now my requirement is when SUM is done for every job i want the label of the sum = SUM of <JOBNAME>. I am not able to do it.This code displays records job wise when job changes the page break is there and the job is displayed in title.
Please find the code.
==============
SET NEWPAGE 0
SET PAGESIZE 56
clear columns
clear breaks
clear computes
undefine job_var
--Set the linesize, which must match the number of equals signs used
--for the ruling lines in the headers and footers.
SET LINESIZE 180
--Set up page headings and footings
TTITLE CENTER 'The Fictional Company' SKIP 3 -
LEFT 'I.S. Department' -
RIGHT 'Project Hours and Dollars Detail' SKIP 1 -
LEFT '========================================' -
'==========================' -
SKIP 2 'job: ' FORMAT A15 job_var
BTITLE LEFT '========================================' -
'==========================' -
SKIP 1 -
RIGHT 'Page ' FORMAT 999 SQL.PNO
--Format the columns
COLUMN job NEW_VALUE job_var
set heading on
--Breaks and Computations
BREAK ON job SKIP page NODUPLICATES
compute sum label 'sum-&job_var' of sal on job;
--Execute the query to generate the report.
SELECT JOB, deptno,ENAME , SAL FROM EMP
ORDER BY JOB;
define
The problem is in MASTER_DEATIL report in SQL
I have the value of job column in variable job_var. Now my requirement is when SUM is done for every job i want the label of the sum = SUM of <JOBNAME>. I am not able to do it.This code displays records job wise when job changes the page break is there and the job is displayed in title.
Please find the code.
==============
SET NEWPAGE 0
SET PAGESIZE 56
clear columns
clear breaks
clear computes
undefine job_var
--Set the linesize, which must match the number of equals signs used
--for the ruling lines in the headers and footers.
SET LINESIZE 180
--Set up page headings and footings
TTITLE CENTER 'The Fictional Company' SKIP 3 -
LEFT 'I.S. Department' -
RIGHT 'Project Hours and Dollars Detail' SKIP 1 -
LEFT '========================================' -
'==========================' -
SKIP 2 'job: ' FORMAT A15 job_var
BTITLE LEFT '========================================' -
'==========================' -
SKIP 1 -
RIGHT 'Page ' FORMAT 999 SQL.PNO
--Format the columns
COLUMN job NEW_VALUE job_var
set heading on
--Breaks and Computations
BREAK ON job SKIP page NODUPLICATES
compute sum label 'sum-&job_var' of sal on job;
--Execute the query to generate the report.
SELECT JOB, deptno,ENAME , SAL FROM EMP
ORDER BY JOB;
define