set verify and set define

本文详细介绍了如何在SQL*Plus环境中使用setverify和setdefine命令来管理变量的替换及显示行为。通过这些命令可以控制变量的输入提示及替换后的SQL语句显示,帮助用户更好地管理和调试SQL查询。

set verify [SQL*PluS]

set verify on
set verify off
If verify is on, SQL*Plus prints two lines for each substituted variable (see set define).

Storing settings across sessions

[@more@]

set verify [SQL*PluS]

set verify on
set verify off
If verify is on, SQL*Plus prints two lines for each substituted variable (see set define).

Storing settings across sessions

Settings (such as verify) can be stored accross sessions with the glogin.sql and/or login.sql file.

set define [SQL*Plus]

set define on
set define off
set define x

set define x

set define x specifies the prefix-character for substitution variables. The default is the ampersand (&).
set define +

 * from  
 where object_name  '%+object_name%';

set define on

Turns on substitution variables.
set define on

select '&hello' from ;
If define is set to on and SQL*Plus finds the current substituion prefix, it asks for a string to be entered. In the following example, I entered: this string was entered
Enter value for hello: this string was entered
old   1: select '&hello' from dual
new   1: select 'this string was entered' from dual

'THISSTRINGWASENTERED'
-----------------------
this string was entered
It might be annoying to see the following lines printed by SQL*Plus:
old   1: select '&hello' from dual
new   1: select 'this string was entered' from dual
This behavior can be turned off by setting verify off.

set define off

Turns off substitution variables.
set define off

select '&hello' from ;
'&HELL
------
&hello

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/330796/viewspace-891307/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/330796/viewspace-891307/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值