operator | operation |
+ | 加 |
- | 减 |
/ | 除 |
* | 乘 |
** | 乘方 |
operator | operation |
< | 小于操作符 |
<= | 小于或等于操作符 |
> | 大于操作符 |
>= | 大于或等于操作符 |
= | 等于操作符 |
!= | 不等于操作符 |
<> | 不等于操作符 |
:= | 赋值操作符 |
operator | operation |
IS NULL | 如果操作数为NULL返回TRUE |
LIKE | 比较字符串值 |
BETWEEN | 验证值是否在范围之内 |
IN | 验证操作数在设定的一系列值中 |
operator | operation |
AND | 两个条件都必须满足 |
OR | 只要满足两个条件中的一个 |
NOT | 取反 |
declare v_comm_percent constant number:=10; begin update emp set comm=sal*v_comm_percent where deptno=10; end SQL> / PL/SQL procedure successfully completed. SQL> |
create or replace procedure update_commission (v_dept in number,v_pervent in number default 10) is begin update emp set comm=sal*v_percent where deptno=v_dept; end SQL>/ Procedure created SQL>execute update_commission(10,15); PL/SQL procedure successfully completed. SQL> |
declare v_dept number; begin select a.deptno into v_dept from emp a where job=''PRESIDENT'' update_commission(v_dept); end SQL>/ PL/SQL procedure successfully completed SQL> |