2 glbyxiong123 glbyxiong123 于 2013.11.01 15:15 提问

oracle10g PLS-00103: 出现符号 "CREATE" 怎么解决啊
create or replace procedure autocomputer is 

rs_cursor SYS_REFCURSOR;
comment_array myPackage.my.Array;
match number;
article number;
sport number;
total number;
average number;
student_id number;
record myPackage.stdInfo;
i number;
begin
i :=1;
get_comment(comment_array);
open rs_cursor for select t.student_id,t.match,t.article,t.sport from student t ;
loop
fetch rs_cursor into student_id,match ,article ,sport; exit when rs_cursor%NOTFOUND;
total := match + article + sport;
for i in 1..comment_array.count
loop
if record.s_comment = 'a' then
begin
total := total + 20;
exit;--跳出for循环
end;
end if;
end loop;
<> average := total / 3;
update student t set t.total = total, t.average = average where t.student_id = student_id;
end loop;
end autocomputer;
-- 取得学生课外评分信息

create or replace procedure get_comment(commentArray out myPackage.myArray) is

--PLS-00103: 出现符号 "CREATE"

rs SYS_REFCURSOR ;

record myPackage.stdInfo;

stu_id number(30);

s_comment char(1);

i number;

begin

open rs for select stu_id,s_comment from out_school

i := 1;

LOOP

fetch rs into stu_id,s_comment; exit when rs%NOTFOUND;

record.stu_id := stu_id;

record.s_comment := s_comment;

recommentArray(i) := record;

i:=i + 1;

end LOOP;

end get_comment;

-- 定义数组类型myArray

create or replace package myPackage is begin

type stdInfo is record(stu_id number,s_comment char(1));

type myArray is table of stdInfo index by binary_integer;

end myPackage;

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!