oracle存储过程超详细使用手册 联系客服

发布时间 : 星期二 文章oracle存储过程超详细使用手册更新完毕开始阅读

total := math + article + language + music + sport; for i in 1..commentArray.count LOOP record := commentArray(i); if stdId = record.stdId then begin

if record.comment = 'A' then begin total := total + 20;

go to next; --使用go to跳出for循环 end; end if; end; end if; end LOOP;

<> average := total / 5;

update student t set t.total=total and t.average = average where t.stdId = stdId; end LOOP; end;

end autocomputer;

--取得学生评论信息的存储过程

create or replace procedure get_comment(commentArray out myPackage.myArray) is rs SYS_REFCURSOR; record myPackage.stdInfo; stdId varchar(30); comment varchar(1); i number; begin

open rs for select stdId,comment from out_school i := 1; LOOP

fetch rs into stdId,comment; exit when rs%NOTFOUND; record.stdId := stdId; record.comment := comment; recommentArray(i) := record; i:=i + 1; end LOOP; end get_comment; --定义数组类型myArray

create or replace package myPackage is begin

type stdInfo is record(stdId varchar(30),comment varchar(1)); type myArray is table of stdInfo index by binary_integer; end myPackage;