konhon

忘掉過去,展望未來。找回自我,超越自我。
逃避不一定躲的过, 面对不一定最难过, 孤单不一定不快乐, 得到不一定能长久, 失去不一定不再拥有, 可能因为某个理由而伤心难过, 但我却能找个理由让自己快乐.

Google

BlogJava 首页 新随笔 联系 聚合 管理
  203 Posts :: 0 Stories :: 61 Comments :: 0 Trackbacks

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

posted on 2005-10-17 05:48 konhon 优华 阅读(371) 评论(0)  编辑  收藏 所属分类: Oracle

只有注册用户登录后才能发表评论。


网站导航: