CREATE OR REPLACE
PROCEDURE proc_monitor_detail
--查询考试安排详细 examName,BeginTime,addTime,Address,Course_Name
(
v_examID IN NUMBER DEFAULT NULL ,
v_examName OUT VARCHAR2,
v_beginTime OUT VARCHAR2,
v_addTime OUT VARCHAR2,
v_Address OUT VARCHAR2,
v_courseName OUT VARCHAR2,
v_paperTitle OUT VARCHAR2,
v_paperTime OUT CHAR,
v_readTeacherName OUT VARCHAR2
)
AS
v_courseCode CHAR(3);
v_readTeacherID VARCHAR2(50);
v_paperID NUMBER(10,0);
v_table_spec VARCHAR2(500);
v_table_name CHAR(5);
BEGIN
SELECT PaperID ,
ExamArrangement.CourseCode ,
ExamName ,
BeginTime ,
addTime ,
ADDRESS ,
Course_Name ,
UserInfo.Name
INTO v_paperID,
v_courseCode,
v_examName,
v_beginTime,
v_addTime,
v_Address,
v_courseName,
v_readTeacherName
FROM ExamArrangement ,
CourseInfo ,
UserInfo
WHERE ExamID = v_examID
AND ExamArrangement.CourseCode = CourseInfo.Course_Code
AND ExamArrangement.ReadTeacherID = UserInfo.UserID;
v_table_name := 'SJ' || v_courseCode ;
v_table_spec := 'select Time from ' || v_table_name || ' where PaperID='||v_paperID;
--DBMS_OUTPUT.PUT_LINE(v_table_spec);
execute immediate v_table_spec INTO v_paperTime;
v_table_spec := 'select Title from ' || v_table_name || ' where PaperID='||v_paperID;
execute immediate v_table_spec INTO v_paperTitle;
END;
PROCEDURE proc_monitor_detail
--查询考试安排详细 examName,BeginTime,addTime,Address,Course_Name
(
v_examID IN NUMBER DEFAULT NULL ,
v_examName OUT VARCHAR2,
v_beginTime OUT VARCHAR2,
v_addTime OUT VARCHAR2,
v_Address OUT VARCHAR2,
v_courseName OUT VARCHAR2,
v_paperTitle OUT VARCHAR2,
v_paperTime OUT CHAR,
v_readTeacherName OUT VARCHAR2
)
AS
v_courseCode CHAR(3);
v_readTeacherID VARCHAR2(50);
v_paperID NUMBER(10,0);
v_table_spec VARCHAR2(500);
v_table_name CHAR(5);
BEGIN
SELECT PaperID ,
ExamArrangement.CourseCode ,
ExamName ,
BeginTime ,
addTime ,
ADDRESS ,
Course_Name ,
UserInfo.Name
INTO v_paperID,
v_courseCode,
v_examName,
v_beginTime,
v_addTime,
v_Address,
v_courseName,
v_readTeacherName
FROM ExamArrangement ,
CourseInfo ,
UserInfo
WHERE ExamID = v_examID
AND ExamArrangement.CourseCode = CourseInfo.Course_Code
AND ExamArrangement.ReadTeacherID = UserInfo.UserID;
v_table_name := 'SJ' || v_courseCode ;
v_table_spec := 'select Time from ' || v_table_name || ' where PaperID='||v_paperID;
--DBMS_OUTPUT.PUT_LINE(v_table_spec);
execute immediate v_table_spec INTO v_paperTime;
v_table_spec := 'select Title from ' || v_table_name || ' where PaperID='||v_paperID;
execute immediate v_table_spec INTO v_paperTitle;
END;