Jason Sun

木水鱼

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

DEF[INE] {c|OFF|ON}

设置置换变量的前缀字符。

[OFF]:不扫描置换变量,不替换置换变量的值。此设置会覆盖系统变量SCAN的设置。

[ON]:扫描并替换置换变量的值。设为ON后会自动把置换变量前缀改为“&”。

[c]:设置置换变量的前缀字符为指定字符。

代码
SQL> set define #

SQL
> define aa=scott.dept

SQL
> select * from #aa; ---将把此处的置换变量#aa替换为scott.dept

原值
1: select * from #aa

新值
1: select * from scott.dept



DEPTNO DNAME LOC

---------- -------------- -------------

10 ACCOUNTING NEW YORK

20 RESEARCH DALLAS

30 SALES CHICAGO

40 OPERATIONS BOSTON



SQL
> set define off ---禁止扫描替换变量

SQL
> select * from #aa; ---此处的#aa不再作为置换变量,因此将会出错

select * from #aa

*

ERROR 位于第
1 行:

ORA
-00911: 无效字符

 

 

 

posted on 2010-08-10 16:46  Jason Sun(木水鱼)  阅读(222)  评论(0编辑  收藏  举报