我面临一个奇怪的问题。它向我展示了:
第 28 行的错误:PLS-00103:在预期以下情况之一时遇到符号“文件结尾”:
代码如下:
CREATE OR REPLACE FUNCTION st_atten_up(stu_id IN student_info.id%type,app_mon IN student_attendence.month%type)
RETURN NUMBER
IS
PRAGMA AUTONOMOUS_TRANSACTION;
att1 NUMBER;
CURSOR c1(sid IN student_info.id%type, pmon IN student_attendence.month%type) IS
SELECT ATTENDANCE
FROM STUDENT_ATTENDENCE
WHERE id = sid and month = pmon;
-- You may want a smaller variable if you know the result will be smaller
BEGIN
open c1;
fetch c1(stu_id,app_mon) into att1;
c1;
att1 :=att1 + 1;
UPDATE STUDENT_ATTENDENCE
SET STUDENT_ATTENDENCE.ATTENDANCE = att1
where STUDENT_ATTENDENCE.ID = stu_id and STUDENT_ATTENDENCE.month = app_mon;
COMMIT;
return att1;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
raise_application_error(-20001,'An error was encountered - '||SQLCODE||' -ERROR- '||SQLERRM);
END;
我不明白这里有什么问题。