当前位置:网站首页>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;
边栏推荐
- BioVendor sRAGE蛋白解决方案
- 基于订单流工具,我们能看到什么?
- SlicePlane的Heading角度与Math.atan2(y,x)的对应转换关系
- metaRTC5.0编程之p2p网络穿透(stun)指南
- 吴恩达深度学习测验题:deeplearning.ai-week1-quiz
- 指定默认参数值 仍报错:error: the following arguments are required:
- metaRTC5.0 API编程指南(一)
- CPG 固体支持物研究:Lumiprobe通用 CPG II 型
- 109. simple chat room 12: realize client-side one-to-one chat
- 中小型水库大坝安全自动监测系统解决方案
猜你喜欢
随机推荐
How to do a good job of gateway high availability protection in the big promotion scenario
Deeplearning ai-week1-quiz
店铺进销存管理系统源码
2022 low voltage electrician examination questions and answers
[JVM series] JVM tuning
Dart学习——函数、类
Metartc5.0 API programming guide (I)
109. simple chat room 12: realize client-side one-to-one chat
sqlmap工具使用手册
Lumiprobe cell imaging analysis: PKH26 cell membrane labeling kit
Intensive learning notes
DPDK 源码测试时性能下降问题
【JVM系列】JVM调优
Leetcode 88: merge two ordered arrays
How to design an awesome high concurrency architecture from scratch (recommended Collection)
What are functions in C language? What is the difference between functions in programming and functions in mathematics? Understanding functions in programming languages
Unity out ref params
证明素数/质数有无限多个
JSP
Reactive dye research: lumiprobe af594 NHS ester, 5-isomer



![[JVM] - memory partition in JVM](/img/d8/29a5dc0ff61e35d73f48effb858770.png)



![[JVM series] JVM tuning](/img/e1/086f76ec6c9b56d97430b1e073f5a6.png)

