Gerrit-Jan Linker
|
SQL Reporting Using SQL reports can be created. The SQL is used to retrieve the data and using SQL*XL commands reporting specific functions can be performed such as formatting a column, changing the column headings and skipping rows. SQL: Write an SQL select statement (a query) to retrieve the information you want to return into your report. SQL*XL reporting commands: To change a column heading you can use the column command. For example running the following command will set the column header to "Employee Id" each time a column emp_id is returned: column emp_id heading "Employee Id"; select emp_id, name from employees; To apply a specific format to the data in a column you can also use the column command. For example if you want to set the number format each time column sal is returned you can use: column sal format "$ #,##0.00"; select sal, name from employees; To skip lines when a certain column changes value you can use the break command. To skip lines when the deptno is changed use this command: break on deptno skip 2; select sal, name, deptno from employees order by deptno;
|