TAILIEUCHUNG - Oracle PL/SQL by Example- P5

Tham khảo tài liệu 'oracle pl/sql by example- p5', công nghệ thông tin, cơ sở dữ liệu phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | LAB Built-in Exceptions 172 for a particular student. The second exception TOO_MANY_ROWS is raised if a particular student is enrolled in more than one course. Consider what happens if you run this example for three different values of student ID 102 103 and 319. The first run of the example student ID is 102 produces the following output Enter value for sv_student_id 102 old 2 v_student_id NUMBER sv_student_id new 2 v_student_id NUMBER 102 Check if the student is enrolled Student is enrolled in too many courses PL SQL procedure successfully completed. The first time a user entered 102 for the value of student ID. Next the first DBMS_OUTPUT. PUT_LINE statement is executed and the message Check if the . is displayed on the screen. Then the SELECT INTO statement is executed. You probably noticed that the statement following the SELECT INTO statement was not executed. When the SELECT INTO statement is executed for student ID 102 multiple rows are returned. Because the SELECT INTO statement can return only a single row control is passed to the exception-handling section of the block. Next the PL SQL block raises the proper exception. As a result the message Student is enrolled in too many courses is displayed on the screen and this message is specified by the exception TOO_MANY_ROWS. DID YOU KNOW Built-in exceptions are raised you only need to specify what action must be taken in the case of a particular exception. A second run of the example student ID is 103 produces the following output Enter value for sv_student_id 103 old 2 v_student_id NUMBER sv_student_id new 2 v_student_id NUMBER 103 Check if the student is enrolled The student is enrolled into one course PL SQL procedure successfully completed. In this second run a user entered 103 for the value of student ID. As a result the first statement is executed and the message Check if the . is displayed on the screen. Then the SELECT INTO statement is

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.