-3
Declare
vStudent_id grade.student_id%TYPE;
vSection_id grade.section_id%TYPE;
vNumeric_grade grade.numeric_grade%TYPE;
CURSOR gradeCursor IS
SELECT student_id,section_id,numeric_grade
FROM grade
WHERE student_id = 102
ORDER by numeric_grade;
Begin
Open gradeCursor;
LOOP
FETCH gradeCursor
INTO vStudent_id,vSection_id,vNumeric_grade;
EXIT WHEN gradeCursor%NOTFOUND;
DBMS_OUTPUT.PUT_LINE('Student number: ' || vStudent_id);
DBMS_OUTPUT.PUT_LINE('Section_id: ' || vSection_id);
IF numeric_grade IS NOT NULL THEN
DBMS_OUTPUT.PUT_LINE('Numeric Grade: ' || vNumeric_grade);
ELSE
DBMS_OUTPUT.PUT_LINE('Numeric Grade: NULL');
END IF;
END LOOP;
IF gradeCursor%ISOPEN THEN CLOSE gradeCursor; END IF;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Error dected');
IF gradeCursor%ISOPEN THEN CLOSE gradeCursor; END IF;
END;
エラーメッセージは何ですか? –
"rdbms"ではなく実際のrdbmsにタグを付けることができますか?私はオラクルを推測している – Kritner