oracle的替代变量
2013-06-28 14:02
197 查看
1.
select empno,ename,sal,job,deptno from emp
where deptno=&no
2.
对字符变量的处理
select ename,job from emp where job=&job;
输入的变量添加''
3.复用替代变量(&&)
select ename,job,&&v_col from emp
order by &v_col
4.取消定义的替代变量,重新赋值
undefine v_col
5.
复杂的表达式
select &co1,&col2 from &table_name
where &condition
order by &sorting
6.define替换变量
define v_job=CLERK
select ename,sal,job from emp where job='&v_job'
order by sal;
7.accept替代变量
(先举例:select ename,sal,job from emp where job=upper('&v_job') order by sal
8.如何使用accept命令的hide的选项
select ename,sal,job from emp where '&pwd'='MANAGER'
select empno,ename,sal,job,deptno from emp
where deptno=&no
2.
对字符变量的处理
select ename,job from emp where job=&job;
输入的变量添加''
3.复用替代变量(&&)
select ename,job,&&v_col from emp
order by &v_col
4.取消定义的替代变量,重新赋值
undefine v_col
5.
复杂的表达式
select &co1,&col2 from &table_name
where &condition
order by &sorting
6.define替换变量
define v_job=CLERK
select ename,sal,job from emp where job='&v_job'
order by sal;
7.accept替代变量
(先举例:select ename,sal,job from emp where job=upper('&v_job') order by sal
8.如何使用accept命令的hide的选项
select ename,sal,job from emp where '&pwd'='MANAGER'
相关文章推荐
- Oracle替代变量(Substitution Variable )的用法
- Oracle之set define off 关闭替代变量功能-yellowcong
- Oracle中替代变量(动态参数)的使用
- oracle的boolean变量和替代变量
- oracle替代变量
- oracle中关于替代变量,accpt,绑定变量,字符变量
- ORACLE SQL 替代变量和SQLPLUS环境命令
- ORACLE变量定义及使用(另,T-SQL EXISTS的PLSQL替代写法)
- 【oracle】替代变量
- Oracle "set define off" 关闭替代变量功能
- 用Oracle绑定变量替代sql语句里常量
- Oracle---替代变量
- oracle 的替代变量&和&&
- Oracle 数据库的绑定变量特性及应用
- Oracle9i有多个数据库时,需注意Oracle_SID环境变量或者注册表中的HOME0变量
- ORACLE 绑定变量用法总结
- oracle中的包变量
- ORACLE 绑定变量用法总结
- Oracle 包变量的一种使用
- oracle在存储过程中给变量赋值