当前位置:网站首页>Oracle 条件、循环语句
Oracle 条件、循环语句
2022-06-28 05:21:00 【辕小白】
条件语句

1.if 语句
create or replace procedure pro_emp1(aa in number)
as
begin
if aa =1 then
dbms_output.put_line('jdmd');
end if;
end pro_emp1;
2.if elsif 语句
create or replace procedure pro_emp2(aa number)
as
begin
if aa =1 then
dbms_output.put_line('jdmd');
elsif aa =2 then
dbms_output.put_line('knjw');
else
dbms_output.put_line('ayxdl');
end if;
end pro_emp2;
3.when 语句
create or replace PROCEDURE PRO_EMP3
(
AA IN NUMBER
) AS
BEGIN
case aa
when 1 then
dbms_output.put_line('sky');
when 2 then
dbms_output.put_line('sky2');
else
dbms_output.put_line('sk3');
end case;
END PRO_EMP3;
循环语句

1.goto 循环
create or replace procedure pro_x1
as
x number;
begin
x:=1;
<<gz_goto>>
x:=x+1;
dbms_output.put_line(x);
if x <5 then
goto gz_goto;
end if;
end pro_x1;
2.loop 循环
create or replace PROCEDURE PRO_X2
AS
x number;
BEGIN
x :=1;
loop
exit when x>9;
x:= x+1;
dbms_output.put_line(x);
end loop;
END PRO_X2;
3.for 循环
create or replace PROCEDURE PRO_X3 AS
x number;
BEGIN
for x in 1..9 loop
dbms_output.put_line(x);
end loop;
END PRO_X3;
4.while 循环
create or replace PROCEDURE PRO_X4 AS
x number;
BEGIN
x:=1;
while x<9 loop
x:=x+1;
dbms_output.put_line(x);
end loop;
END PRO_X4;
边栏推荐
- CpG solid support research: lumiprobe general CpG type II
- 【LeetCode】12、整数转罗马数字
- CSCI GA scheduling design
- It is the latest weapon to cross the blockade. It is one of the fastest ladders.
- 基于订单流工具,我们能看到什么?
- Sharing | intelligent environmental protection - ecological civilization informatization solution (PDF attached)
- 【JVM】——JVM中内存划分
- [JVM series] JVM tuning
- JSP
- Liuhaiping's mobile phone passes [[uiapplication sharedapplication] delegate] window. safeAreaInsets. The height of the bottom security zone is 0
猜你喜欢

Voltage mode and current mode control of switching power supply

拉萨手风琴

Sharing | intelligent environmental protection - ecological civilization informatization solution (PDF attached)

Wedding studio portal applet based on wechat applet

羧酸研究:Lumiprobe 磺基花青7二羧酸

Biovendor sRAGE protein solution

2022 new version NFT source code source code of China meta universe digital collection art trading platform

JS text box loses focus to modify width text and symbols

CPG 固体支持物研究:Lumiprobe通用 CPG II 型
![[untitled] drv8825 stepping motor drive board schematic diagram](/img/30/02f695592f3b624ebbb2b7a9f68052.png)
[untitled] drv8825 stepping motor drive board schematic diagram
随机推荐
Wedding studio portal applet based on wechat applet
Docker installs mysql5.7 and starts binlog
Keil C51的Data Overlaying机制导致的函数重入问题
Concurrent wait/notify description
摄像头基础知识
Programmer - Shepherd
metaRTC5.0 API编程指南(一)
PMP考试成绩多久出来?这些你务必知道!
Pcr/qpcr research: lumiprobe dsgreen is used for real-time PCR
刘海屏手机在部分页面通过[[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom得到底部安全区高度为0问题
【LeetCode】12、整数转罗马数字
Extjs图书管理系统源码 智能化图书管理系统源码
What are functions in C language? What is the difference between functions in programming and functions in mathematics? Understanding functions in programming languages
Sqlmap tool user manual
[skywalking] learn distributed link tracking skywalking at one go
JSP
JS 文本框失去焦点修改全半角文字和符号
BioVendor sRAGE抗体解决方案
【JVM系列】JVM调优
中小型水库大坝安全自动监测系统解决方案