Question: TASK 1 Create a PL/SQL block that uses an explicit record-based cursor with two parameters . Declare a cursor that accepts two parameters job id
TASK 1
Create a PL/SQL block that uses an explicit record-based cursor with two parameters.
- Declare a cursor that accepts two parameters job id and minimum salary. The cursor retrieves underpaid employees whose salaries are lower than minimum salary working as job id.
- To list underpaid employees working as Accountant, open the cursor and pass the job id and the minimum salary as below:
OPEN c_employee('FI_ACCOUNT', 8000); --- Accountant
- Fetch each row in the cursor and show the employees information and close the cursor.
- To list underpaid employees working as Administration Assistant, open the cursor for the second time but with different arguments as below:
OPEN c_employee('AD_ASST', 5000); --- Administration Assistant
- Fetch the data, print out employees information, and close the cursor.
- Format the output to be similar to the below.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
