Professional Documents
Culture Documents
UW
Date: 22- 05 – 21 Discipline/Semester: BSCS 6th B
Course Code: CS-320
Course: Database Application
Total Marks: 10
0 times
2. Write a PL/SQL block that handles by name the following Oracle error: ORA-
1014: ORACLE shutdown in progress. The exception handler should, in turn,
raise a VALUE_ERROR exception. Hint: use the EXCEPTION INIT pragma .
(3 marks)
3. Identify the problems with (or areas for improvement in) the following loops. How
would you change the loop to improve it? (10 marks)
a.
Answer:
Replace if with changing loop condition
for i in 1 .. 76
loop
calc_totals(i);
end loop;
b.
emp_rec emp_cur%ROWTYPE;
4. Rewrite the following loop so that you do not use a loop at all. (5 marks)
5. What cursor-related statements are missing from the following block? (5 marks)
close emp_cur;
end;
a.