Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Define a strong cursor variable type, name it EmpCurTyp. Its return type is employees%ROWTYPE, based on table Employees. Then declare a cursor variable of this
Define a strong cursor variable type, name it EmpCurTyp. Its return type is employees%ROWTYPE, based on table Employees. Then declare a cursor variable of this type. In your program, first you will open the cursor variable for a select statement as SELECT * FROM employees WHERE department_id = deptid ORDER BY last_name; Where deptid is a variable of data type number (4) with an initial value 20. Your program will print out the employees' employee ID and full names in this department 20. (please pay attention, the Cursor-For loop does NOT work for cursor variable) Then, open that cursor variable again, this time for the statement as below SELECT * FROM employees WHERE commission_pct >= 0.3 and salary >= 12000 ORDER BY employee_id; then print out these employees' IDs, first names, last names, their salaries and commission rates. Last, do not forget to close the cursor variable
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Heres how you can define and use the cursor variable EmpCurTyp in PLSQL sql Define the cursor variab...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started