SQL*Plus:格式化输出
Tips:最近在看过去的书,这里,罗列一下关于SQL*Plus格式化输出的相关主题与知识点。
查看当前SQL*Plus中的所有可用的设置清单:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
SQL> show all appinfo is OFF and set to "SQL*Plus" arraysize 15 autocommit OFF autoprint OFF autorecovery OFF autotrace OFF blockterminator "." (hex 2e) btitle OFF and is the first few characters of the next SELECT statement cmdsep OFF colsep " " compatibility version NATIVE concat "." (hex 2e) copycommit 0 COPYTYPECHECK is ON define "&" (hex 26) describe DEPTH 1 LINENUM OFF INDENT ON echo OFF editfile "afiedt.buf" embedded OFF errorlogging is OFF escape OFF escchar OFF exitcommit ON colinvisible OFF FEEDBACK ON for 6 or more rows flagger OFF flush ON fullcolname OFF heading ON headsep "|" (hex 7c) instance "local" linesize 80 lno 14 loboffset 1 logsource "" long 80 longchunksize 80 markup HTML OFF HEAD "<style type='text/css'> body {font:10pt Arial,Helvetica,sans-serif; color:black; background:White;} p {font:10pt Arial,Helvetica,sans-serif; color:black; background:White;} table,tr,td {font:10pt Arial,Helvetica,sans-serif; color:Black; background:#f7f7e7; padding:0px 0px 0px 0px; margin:0px 0px 0px 0px;} th {font:bold 10pt Arial,Helvetica,sans-serif; color:#336699; background:#cccc99; padding:0px 0px 0px 0px;} h1 {font:16pt Arial,Helvetica,Geneva,sans-serif; color:#336699; background-color:White; border-bottom:1px solid #cccc99; margin-top:0pt; margin-bottom:0pt; padding:0px 0px 0px 0px;- } h2 {font:bold 10pt Arial,Helvetica,Geneva,sans-serif; color:#336699; background-color:White; margin-top:4pt; margin-bottom:0pt;} a {font:9pt Arial,Helvetica,sans-serif; color:#663300; background:#ffffff; margin-top:0pt; margin-bottom:0pt; vertical-align:top;}</style><title>SQL*Plus Report</title>" BODY "" TABLE "border='1' width='90%' align='center' summary='Script output'" SPOOL OFF ENTMAP ON PREFORMAT OFF newpage 1 null "" numformat "" numwidth 10 pagesize 14 PAUSE is OFF pno 0 recsep WRAP recsepchar " " (hex 20) release 1201000200 repfooter OFF and is NULL repheader OFF and is NULL securedcol is OFF serveroutput OFF shiftinout INVISIBLE showmode OFF spool OFF sqlblanklines OFF sqlcase MIXED sqlcode 0 sqlcontinue "> " sqlnumber ON sqlpluscompatibility 12.1.0 sqlprefix "#" (hex 23) sqlprompt "SQL> " sqlterminator ";" (hex 3b) suffix "sql" tab ON termout ON timing OFF trimout ON trimspool OFF ttitle OFF and is the first few characters of the next SELECT statement underline "-" (hex 2d) USER is "SYS" verify ON wrap : lines will be wrapped xmloptimizationcheck OFF SQL> |
关于页面大小(显示多少行数据才分页?):
1 2 3 4 5 6 7 8 9 10 11 12 13 |
查看: SQL> show pagesize pagesize 14 SQL> 修改设定: SQL> set pagesize 900 SQL> 再次查看: SQL> show pagesize pagesize 900 SQL> |
行宽:
1 2 3 4 5 6 7 |
SQL> show linesize linesize 80 SQL> SQL> set linesize 900 SQL> show linesize linesize 900 SQL> |
页标题:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
设置前: SQL> select instance_name,status from v$instance; INSTANCE_NAME STATUS ---------------- ------------ conorcl OPEN SQL> 设置后: SQL> ttitle 'About Oracle database | Database status' SQL> select instance_name,status from v$instance; Fri Sep 04 page 1 About Oracle database Database status INSTANCE_NAME STATUS ---------------- ------------ conorcl OPEN SQL> |
————————————————
Done。