PLsql cursor, procedure,trigger
PLsql cursor, procedure,trigger
PLsql cursor, procedure,trigger
1. Employees Table
Name VARCHAR2(50),
Department VARCHAR2(50),
Salary NUMBER
);
2. Audit Table
EmpID NUMBER,
OldSalary NUMBER,
NewSalary NUMBER,
UpdatedBy VARCHAR2(50),
UpdatedOn DATE
);
Tasks
1. Cursor
Uses a cursor to fetch employee details (Name and Salary) whose salaries exceed a specified
value.
Example Output:
2. Trigger
Includes fields such as the old salary, new salary, employee ID, user updating the record, and
the timestamp.
3. Procedure
o Employee ID (EmpID)
Updates the department in the Employees table and prints a confirmation message.