Sql*plus中, 不允许sql语句中间有空行, 这在从其它地方拷贝脚本到sql*plus中执行时很麻烦. 比如下面的脚本:
select deptno, empno, ename
from emp
where empno = '7788';
如果拷贝到sql*plus中执行, 就会出现错误:
scott@O9I.US.ORACLE.COM> select deptno, empno, ename
2 from emp
3
where empno = '7788';
SP2-0734: unknown command beginning "where empn..." - rest of line ignored.
原因是sqlplus遇到空行就认为是语句结束了.
其实要改变这种现象, 只要使用SQLBLANKLINES参数就可以了.
scott@O9I.US.ORACLE.COM> SET SQLBLANKLINES ON
scott@O9I.US.ORACLE.COM>
scott@O9I.US.ORACLE.COM> select deptno, empno, ename
2 from emp
3
4 where empno = '7788';
DEPTNO EMPNO ENAME
---------- ---------- ----------
20 7788 SCOTT