Question
1 Create a PL/SQL block to declare a cursor EMP_CUR to select the employee name, salary and hiredate from emp table. Process each row from
1 Create a PL/SQL block to declare a cursor EMP_CUR to select the employee name, salary and hiredate from emp table. Process each row from the cursor, and if the salary is greater than 4000 and the hiredate is greater than 01-FEB-1980 , display the employee name , salary and hiredate.
Question 2 The purpose of this practice is to show the usage of predefined exceptions. Write a PL/SQL block to select the name of the employee with a given salary value. a) In the declarative section, declare two variables: v_ename of type emp.ename and v_emp_sal of type emp.sal. Initialize the sal to 3000. b) In the executable section, retrieve the name of employees whose salaries are equal to the value in v_emp_sal c) If the salary entered does not return any rows, handle the exception with an appropriate exception handler. d) If the salary entered returns more than one row , handle the exception with an appropriate exception handler an e) Handle any other exception with an appropriate exception handler
Question 3 Create a stored procedure or function called GET_SERVICE_YRS to retrieve the total number of years of service for a specific employee using employee number. Add appropriate error handling to account for an individual employee number.
Tables: https://mega.nz/file/VetRUK6Y#ByXJic0ix_FWMijlP4-e0jqgB22jRiDaf6xjL_JMuDg
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Here are some possible answers to your questions but you should try to understand the logic and syntax behind them You can also refer to some online t...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