控制SQL*Plus的环境和数据字典
1. 控制SQL*Plus的环境
a) SET 环境变量 变量的值
b) SHOW 环境变量 | ALL
SQL> show all
appinfo 为 OFF 并且已设置为"SQL*Plus"
arraysize 15
autocommit OFF
autoprint OFF
autorecovery OFF
autotrace OFF
blockterminator "." (hex 2e)
btitle OFF 为下一条 SELECT 语句的前几个字符
cmdsep OFF
colsep " "
compatibility version NATIVE
concat "." (hex 2e)
copycommit 0
COPYTYPECHECK 为 ON
define "&" (hex 26)
describe DEPTH 1 LINENUM OFF INDENT ON
echo OFF
editfile "afiedt.buf"
embedded OFF
escape OFF
用于 6 或更多行的 FEEDBACK ON
flagger OFF
flush ON
heading ON
headsep "|" (hex 7c)
instance "local"
linesize 80
lno 8
loboffset 1
logsource ""
long 80
longchunksize 80
markup HTML OFF HEAD " body {fo
newpage 1
null ""
numformat ""
numwidth 10
pagesize 14
PAUSE 为 OFF
pno 2
recsep WRAP
recsepchar " " (hex 20)
release 1002000100
repfooter OFF 为 NULL
repheader OFF 为 NULL
serveroutput OFF
shiftinout INVISIBLE
showmode OFF
spool OFF
sqlblanklines OFF
sqlcase MIXED
sqlcode 0
sqlcontinue "> "
sqlnumber ON
sqlpluscompatibility 10.2.0
sqlprefix "#" (hex 23)
sqlprompt "SQL> "
sqlterminator ";" (hex 3b)
suffix "sql"
tab ON
termout ON
timing OFF
trimout ON
trimspool OFF
ttitle OFF 为下一条 SELECT 语句的前几个字符
underline "-" (hex 2d)
USER 为"SCOTT"
verify ON
wrap : 将换至下一行
2. SQL*Plus的环境变量ECHO
将ECHO设置为ON 的时候,运行脚本的时候不但返回运行的结果,而且还返回命令。
SQL> show echo
echo OFF
SQL> set echo on
SQL> show echo
echo ON
SQL> select * from dept;
DEPTNO DNAME LOC
---------- -------------- -------------
10 ACCOUNTING NEW YORK
20 RESEARCH DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
SQL> save "D:s";
已创建 file D:s.sql
SQL> @D:s.sql
SQL> select * from dept
2 /
DEPTNODNAME LOC
---------- -------------- -------------
10ACCOUNTING NEW YORK
20RESEARCH DALLAS
30SALES CHICAGO
40OPERATIONS BOSTON
3. SET FEEDBACK n 表示当查询选择了至少6条记录时,显示返回的记录数;但是如果查询选择的记录数少于6条,就不显示返回的记录数。
4. 以REM开始的语句为注释。
5. USER_* ALL_* DBA_*