(在线等)oracle简单存储过程,菜鸟问题
createorreplaceprocedurepro_stu_score_addisstuIdnumber;mathnumber;articlenumber;langu...
create or replace procedure pro_stu_score_addisstuId number;math number;article number;language number;music number;sport number;total number;average number;step number;cou number;begin declare cursor cur1 is select * from TEST_STUINFO; c_row cur1%rowtype; for c_row in cur1 loop stuId:=c_row.stuId; math:=c_row.math; article:=c_row.article; language:=c_row.language; music:=c_row.music; sport:=c_row.sprot; total:=c_row.total; step:=(math+article+language+music+sport+total); average:=step/6; update TEST_STUINFO set TEST_STUINFO.average=average where TEST_STUINFO.stuId=stuId; select count(*) into cou from TEST_STUINFO_OUT where TEST_STUINFO.stuId=stuId and comments='A'; if cou>0 then begin step:=step+20; end; end if; update TEST_STUINFO set TEST_STUINFO.step=step where TEST_STUINFO.stuId=stuId; end loop; end pro_stu_score_add;
展开
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询