ORACLE Varaible
来源:互联网 发布:牛尔的产品知乎 编辑:程序博客网 时间:2024/05/28 23:11
1) Bind Variable (is session specific and need to be reset if the session is lost)
(note : use F5 to run script, F9 run statement won't work)
VARIABLE v_id NUMBER
BEGIN
:v_id := 1; (need to end with ;)
END; (need to end with ;)
/ (used in SQL*PLUS)
PRINT v_id
SELECT * FROM products WHERE product_id = :v_id;
--use F5 to invoke the value of bind varialbe directly
--use F9, it will prompt to enter value for bind variable
2) Substitution variables
two types : Temporary Variables and Defined variables
Temporary Variables :
SELECT * FROM products WHERE product_id = &v_id;
--use F5 or F9, it will prompt to enter value for substitution variable
Defined Variables :
DEFINE v_id=7
SELECT * FROM products WHERE product_id = &v_id;
--use F5 or F9, it will invoke the pre-defined value of variable
ACCEPT variable [TYPE] [FORMAT format] [PROMPT prompt] [HIDE]
ACCEPT v_id NUMBER FROMAT 99 PROMPT 'product id: '
--use F5 only, it will prompt to enter value for the variable
UNDEFINE v_id
This variable can be used as : &v_id, &&v_id, '&v_Id' or '&&v_id'
SQL>DEFINE
SQL>SET DEFINE '#'
SQL>SET VERIFY ON
SQL>SET VERIFY OFF
- ORACLE Varaible
- inline static varaible
- auto create head file use varaible
- Oracle???
- oracle
- oracle
- oracle
- oracle
- oracle...
- oracle
- oracle
- ORACLE
- Oracle
- ORACLE
- Oracle
- Oracle
- oracle
- oracle
- 解决如何使用opengl超级宝典中实例代码及shared文件夹里的库
- locate 和 find:两个查找文件的命令
- C++ Chapter 6. Inheritance and Object-Oriented Design
- 第十周实验报告3
- Square类型的移动支付,移动POS机
- ORACLE Varaible
- 系统引导时为什么要关闭Caches?
- CUDA学习笔记
- C/C++绘制余弦曲线
- Android4.0.3 显示系统深入理解
- 设计模式(1)-创建型-单件(Singleton)模式 (个人笔记)
- Struts实现上传、下载
- 设计模式(2)-创建型-工厂方法(Factory method)(个人笔记)
- 《Head First设计模式》读书笔记3——装饰模式