当前位置:网站首页>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;
边栏推荐
- 109. simple chat room 12: realize client-side one-to-one chat
- 2022 low voltage electrician examination questions and answers
- 2022 new version NFT source code source code of China meta universe digital collection art trading platform
- How long will the PMP test results come out? You must know this!
- [JVM] - memory partition in JVM
- Don't roll! How to reproduce a paper with high quality?
- 关系数据库与文档数据库对比
- Prove that there are infinite primes / primes
- JSP
- [microservices openfeign] openfeign quick start service invocation based on feign
猜你喜欢

Excel将一行的内容进行复制时,列与列之间是用制表符“\t”进行分隔的

改性三磷酸盐研究:Lumiprobe氨基-11-ddUTP

SlicePlane的Heading角度与Math.atan2(y,x)的对应转换关系

CpG solid support research: lumiprobe general CpG type II

gorm事务体验

The heading angle of sliceplane is the same as that of math Corresponding transformation relation of atan2 (y, x)

codeforces每日5题(均1700)

Keil C51的Data Overlaying机制导致的函数重入问题

Share a powerful tool for factor Mining: genetic programming

交流电和直流电的区别是什么?
随机推荐
Voltage mode and current mode control of switching power supply
CpG solid support research: lumiprobe general CpG type II
!‘ Cat 'is not an internal or external command, nor is it a runnable program or batch file.
Feign implements path escape through custom annotations
How high is the gold content of grade II cost engineer certificate? Just look at this
2022 Western pastry (Advanced) test question simulation test platform operation
氨基染料研究:Lumiprobe FAM 胺,6-异构体
mysql导出数据库字典成excel文件
中小型水库大坝安全自动监测系统解决方案
拉萨手风琴
双向电平转换电路
[skywalking] learn distributed link tracking skywalking at one go
Determine whether an attribute exists in an object
Opencv实现颜色检测
Study on modified triphosphate: lumiprobe amino-11-ddutp
How to design an awesome high concurrency architecture from scratch (recommended Collection)
Store inventory management system source code
Dart learning - functions, classes
[Verilog quick start of Niuke online question brushing series] ~ one out of four multiplexer
If a programmer goes to prison, will he be assigned to write code?