CREATE OR REPLACE PROCEDURE loan_book(
student_num IN INTEGER,
book_num IN INTEGER,
loan_status IN OUT VARCHAR2 )
AS
loan_key INTEGER:=0;
reserve_key INTEGER:=0;
student_status char(1);
book_due DATE;
book_wait INTEGER;
reserved_loaned EXCEPTION;
student_status_error exception;
BEGIN
--检查该学生是否可以借阅和预定图书。
begin
select student_bl_status into student_status
from students
where student_id = student_num;
if student_status == 'f' then
RAISE student_status_error;
end if;
exception
when student_status_error then
dbms_output.put_line('该学生不可以借书和预定书!');
end;
/*Check if the book is on loan or reserved */
--从预定表中查找,书号为book_num的预定号,并放入reserve_key中。
BEGIN
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余3页未读,立即下载