oldwain随便写
===========================================================
===========================================================

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
scott@O9I.US.ORACLE.COM> where empno = '7788';
SP2-0734: unknown command beginning "where empn..." - rest of line ignored.
scott@O9I.US.ORACLE.COM>

原因是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

scott@O9I.US.ORACLE.COM>

(需要引用, 请注明出处: http://oldwain.itpub.net)

oldwain 发表于:2005.09.06 10:06 ::分类: ( Oracle ) ::阅读:(1498次) :: 评论 (3) ::收藏此页到365Key
re: 也许你还不知道 - sqlplus的小秘密(2) [回复]

明天继续来看小秘密tongue

鸿雁 评论于: 2005.09.06 13:16
re: 也许你还不知道 - sqlplus的小秘密(2) [回复]

欢迎!
明天还有.wink.gif laughing

oldwain 评论于: 2005.09.06 13:35
re: 也许你还不知道 - sqlplus的小秘密(2) [回复]

Good

shahand 评论于: 2005.09.28 10:42

发表评论
标题

在此添加评论
表情符号: smile laughing tongue angry crying sad wassat wink

称呼

邮箱地址(可选)

个人主页(可选)

 authimage


自我介绍
切换风格
新闻聚合
博客日历
文章归档...
最新发表...
最新评论...
最多阅读文章...
最多评论文章...
博客统计...
Blog信息
赞助商
网站链接...
其它资源
我的网摘...