您的位置:首页 > 数据库 > Oracle

oracle存储过程if-else if-else

2015-09-14 16:03 513 查看
create or replace
procedure test as 
--建立游标
Cursor ss is select GROUP_NAME from SUMMARYLOG_LIST group by GROUP_NAME;
BEGIN
--for循环
for b in ss loop
BEGIN
if b.GROUP_NAME=null then
insert into AA(hongyan) values(null);
commit;
else if b.GROUP_NAME='02 基建工程' then
insert into AA(hongyan) values('222');
commit;
else
insert into AA(hongyan) select GROUP_NAME from SUMMARYLOG_LIST t
where t.GROUP_NAME=b.GROUP_NAME;
commit;
end if;
end if;
end;--结束一条if判断
END loop;--结束for循环
end;
注意:每条结束语的位置;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: