PLSQL程序控制结构
来源:互联网 发布:软件版本说明模板 编辑:程序博客网 时间:2024/06/06 01:20
if语句,null语句=====================select * from scott.emp;declarev_job scott.emp.job%type;beginselect job into v_job from scott.emp where lower(ename)=lower('&name'); if v_job='MANAGER' then update scott.emp set comm=nvl(comm,0)+100 where lower(ename)=lower('&name'); elsif v_job='PRESIDENT' then update scott.emp set comm=nvl(comm,0)+10 where lower(ename)=lower('&name');elsenull;end if;end;//case表达式 ====================== select * from scott.emp declare v_salary scott.emp.sal%type; bonus_amount number; begin select sal into v_salary from scott.emp where ename='&ename'; bonus_amount := case when v_salary >=1000 and v_salary <=2000 then 150 when v_salary >2000 and v_salary <=3000 then 100 when v_salary >3000 then 50 else 0 end *10; dbms_output.put_line(bonus_amount); end;//for循环=============reverse关键字为倒序插入 select * from temp4 create table temp4( tId number(3) primary key )declare begin for i in 1..10 loop insert into temp4 values(i); end loop; end;//goto语句实现循环控制select * from temp5create table temp5(tId number(3))declare i int :=1; begin loop insert into temp5 values(i); if i=10 then goto end_loop; end if; i:=i+1; end loop; <<end_loop>>dbms_output.put_line('dsa'); end;
0 0
- PLSQL程序控制结构
- Oracle学习笔记(3) PLSQL程序控制结构
- Oracle学习笔记(第三章) PLSQL程序控制结构
- 程序控制结构
- C语言程序控制结构
- Python程序控制结构
- scala程序控制结构
- C语言程序控制结构
- R语言程序控制结构
- unit7 程序控制结构
- Oracle 程序控制结构
- python 程序控制结构
- 三.python程序控制结构
- matlab程序控制结构
- C语言中的程序控制结构
- 3.PL/SQL程序控制结构
- Ch3 PL/SQL程序控制结构
- **JAVASCRIPT** 程序控制结构和函数
- 黑马程序员 Java基础_4 面向对象-抽象与封装
- 如何判断链表中是否有环
- Android命令行/c语言/java设置获取系统属性的方法
- error:MultiByteToWideChar cannot convert parameter 2 from 'char [10]' to 'unsigned short *'
- PL/SQL控制循环结构
- PLSQL程序控制结构
- 【Mac OS X开发】在NSAlert中添加NSTableView,双击NSTableView单元格用于确定选择的效果
- Maya Calendar - POJ 1008 时间转换
- 类簇的概念
- 《HTML 5网页开发实例详解》样章、内容简介、前言
- VxWorks Shell
- 中缀表达式转换成后缀表达式
- PLSQL更改数据及管理事务
- CAS 与 Spring Security 3.1整合配置详解