Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5592757
  • 博文数量: 745
  • 博客积分: 10075
  • 博客等级: 上将
  • 技术积分: 7716
  • 用 户 组: 普通用户
  • 注册时间: 2005-04-29 12:09
文章分类

全部博文(745)

文章存档

2019年(1)

2016年(1)

2010年(31)

2009年(88)

2008年(129)

2007年(155)

2006年(197)

2005年(143)

分类: Oracle

2006-12-27 17:22:35

Double-Ampersand Substitution Variable
You can use the double-ampersand(&&) substitution variable if you want to reuse the variable value without prompting the user each time. The user will see the prompt for the value only once. In the example on the slide, the user is asked to give the value for the column_name variable only once. The value supplied by the user(department_id) is used both for display and ordering of data.
iSQL*Plus stores the value supplied by using the DEFINE command:it uses it again wherever you reference the variable name. Once a user variable is in place,you need to use the UNDEFINE command to delete it.
 
Variables are defined until you either:
 Issue the UNDEFINE command on a variable
 Exit iSQL*Plus
When you undefine variables,you can verify your changes with the DEFINE command. When you exit iSQL*Plus, variables defined during that session are lost.
 
The VERIFY Command
To confirm the changes in the SQL statement, use the iSQL*Plus VERIFY command. Setting SET VERIFY ON forces iSQL*Plus to display the text of a command before and after it replaces substitution variables with values.
 
Creating a Script File to Run a Report
1. Create and test the SQL SELECT statement
2. Save the SELECT statement into a script file
3. Load the script file into an editor
4. Add formatting commands before the SELECT statement
5. Verify that the termination character follows the SELECT statement
6. Clear formatting commands after the SELECT statement
7. Save the script file
8. Load the script file into the iSQL*Plus text window, and click the Execute button
 
阅读(2147) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~