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