📄 08-modpr.sql
字号:
REM 08-MODPR.SQL
REM This file contains the modular programming examples from
REM Chapter 8 of "Oracle PL/SQL Programming".
REM This is version 1.0 of this file, updated 2/18/96.
REM Comments and questions should go to Scott Urman, at
REM surman@us.oracle.com.
REM *** Chapter 8: CalculateGPA stub ***
CREATE OR REPLACE PROCEDURE CalculateGPA(
/* Returns the grade point average for the student identified
by p_StudentID in p_GPA. */
p_StudentID IN students.ID%TYPE,
p_GPA OUT NUMBER) AS
BEGIN
NULL;
END CalculateGPA;
/
REM *** Chapter 8: PrintTranscript stub ***
CREATE OR REPLACE PROCEDURE PrintTranscript(
/* Outputs a transcript for the indicated student. The
transcript will consist of the classes for which the
student is currently registered and the grade received
for each class. At the end of the transcript, the student's
GPA is output. */
p_StudentID IN students.ID%TYPE) AS
v_StudentGPA NUMBER; -- Grade point average for this student.
CURSOR CurrentClasses IS
SELECT *
FROM registered_students
WHERE student_id = p_StudentID;
BEGIN
-- Output some header information about the student such
-- as first and last name, major, etc.
FOR v_ClassesRecord IN CurrentClasses LOOP
-- Output information about each class.
NULL;
END LOOP;
-- Determine the GPA.
CalculateGPA(p_StudentID, v_StudentGPA);
-- Output the GPA.
END PrintTranscript;
/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -