CS405 Final Term Solved Current Paper Set 2 by Maha
- Type
- Final term past paper
- Course
- CS405 Database Programming using Oracle 11g
- Size
- PDF 10.6 MB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 36. Download the file for all 36 pages.
2. Exception Types in PL/SQL:
� Predefined Exceptions: Raised automatically (e.g., � User-Defined Exceptions: Declared manually using
� Example:
DECLARE salary_error EXCEPTION; BEGIN IFsalary < 0 THEN RAISE salary_error; END IF; EXCEPTION WHEN salary_error THEN DBMS_OUTPUT.PUT_LINE(' Invalid Salary'); END;
Short Questions:
1. Table Record:
o A record is a collection of related data items stored as a single unit. o Example:
DECLARE emp_record emp%ROWTYPE; BEGIN SELECT * INTO emp_record FROM emp WHERE empno = 1001; END;
NO_DATA_FOUND EXCEPTION.
o This skips the remaining code in the loop's current iteration when a condition is met. o Example:
2. Records in PL/SQL:
o Similar to structs in C, they store multiple fields in a single variable. o Example: BEGIN
CONTINUE WHEN i = 5; DBMS_OUTPUT.PUT_LINE(i); END LOOP; END;
BEGIN
FOR j IN 1..2 LOOP DBMS_OUTPUT.PUT_LINE('i=' || i || ', j=' || j); DECLARE emp_rec emp%ROWTYPE; BEGIN SELECT * INTO emp_rec FROM emp WHERE empno = 7369; DBMS_OUTPUT.PUT_LINE(emp_rec.ename || ' - ' || emp_rec.sal); END; END LOOP; LOOP; END END;
CREATE OR REPLACE PROCEDURE get_emp_details(emp_id NUMBER) IS emp_name emp.ename%TYPE; BEGIN SELECT ename INTO emp_name FROM emp WHERE empno = emp_id; DBMS_OUTPUT.PUT_LINE(' Employee Name: ' || emp_name); END;
Related CS405 files
All CS405 files →Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.