用PL/SQL 工具无法创建成功,非得用window>start>run>cmd才行呢!就想把它存在一个文档里,这时就需要用到spool (一步一步学,慢慢更新ING。。。).
1. 创建title和底部title:
SQL>TTITLE LEFT '' -
> RIGHT 'Page: ' FORMAT 99 SQL.PNO SKIP 2
SQL> BTITLE CENTER 'Company Confidential'
SQL>
SQL> select * from scott.emp;
2. 创建Btitle:
SQL> set pagesize 22
SQL> set linesize 80
SQL>
SQL> ttitle left 'SQL*Plus report' -
> right 'Page: ' format 99 SQL.PNO -
> skip center 'OVERVIEW' -
> skip center 'emp department 30' -
> skip 2
SQL> btitle col 20 'Confidential' tab 8 -
> 'Created by: ' SQL.USER
SQL> select ename * from scott.emp;
3. 例子
SQL> set echo off
SQL> STORE SET settings REPLACE
SQL> -- set page variables
SQL> set feedback on
SQL> set pagesize 20
SQL> set linesize 100
SQL> -- format columns
SQL> column ename format a36 heading 'Emp Name'
SQL> column deptno format 99 heading 'depatno'
SQL> -- add page header and footer
SQL> ttitle center 'emp REPORT' skip 2
SQL> btitle center 'COMPANY CONFIDENTAL'
SQL> -- write report to file
SQL> spool custrpt
SQL> select ename, deptno from scott.emp;
(回车)
SQL> spool off
SQL> clear columns
SQL> ttitle off
SQL> btitle off
SQL> @settings
SQL> set echo on
本文档介绍了如何使用SQL*Plus工具创建基础简单的报表记录,包括设置标题、页脚、页面大小和列格式,并通过spool功能将报表输出到文档中,详细步骤逐步解析。
3192

被折叠的 条评论
为什么被折叠?



