CSD 4203 - Database Programming Practical exercise 4 Exceptions 1) Run provided SQL script and create...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
CSD 4203 - Database Programming Practical exercise 4 Exceptions 1) Run provided SQL script and create Employees table if you have not one. 2) Write PL/SQL program to ask user to enter employee ID, and find the employee with this id and read his/her salary. In order to assign value to employee id variable, use substitution variable if you use SQL Developer, or assign the value to employee id directly in the code if you use Oracle Live SQL. 3) If employee's salary is negative, raise application error with error code -20001 and message 'Salary is negative, must be fixed!' 4) If salary is positive, output employee id, full name, and salary. 5) If employee with such id does not exist, process NO_DATA_FOUND exception in Exception block (this exception will be raised by PL/SQL). TEST YOUR PROGRAM: Run PL/SQL program and enter some ID and submit the screenshot of the output. - Update manually some employee's salary to become negative, and test your program if it raises error code -20001 and message 'Salary is negative, must be fixed!' exception. Submit the screenshot. - Also, enter some employee ID that does not exist and test if NO_DATA_FOUND exception Is handled. Submit the screenshot of the output. - Submit your PL/SQL program and the screenshots that shows which values you entered for ID and what was the program's output. CSD 4203 - Database Programming Practical exercise 4 Exceptions 1) Run provided SQL script and create Employees table if you have not one. 2) Write PL/SQL program to ask user to enter employee ID, and find the employee with this id and read his/her salary. In order to assign value to employee id variable, use substitution variable if you use SQL Developer, or assign the value to employee id directly in the code if you use Oracle Live SQL. 3) If employee's salary is negative, raise application error with error code -20001 and message 'Salary is negative, must be fixed!' 4) If salary is positive, output employee id, full name, and salary. 5) If employee with such id does not exist, process NO_DATA_FOUND exception in Exception block (this exception will be raised by PL/SQL). TEST YOUR PROGRAM: Run PL/SQL program and enter some ID and submit the screenshot of the output. - Update manually some employee's salary to become negative, and test your program if it raises error code -20001 and message 'Salary is negative, must be fixed!' exception. Submit the screenshot. - Also, enter some employee ID that does not exist and test if NO_DATA_FOUND exception Is handled. Submit the screenshot of the output. - Submit your PL/SQL program and the screenshots that shows which values you entered for ID and what was the program's output.
Expert Answer:
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Posted Date:
Students also viewed these databases questions
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
please make your Terminal window larger by resizing the window if you have not already done so so that we capture as much as possible (drag lower right corner with your mouse). Again note you may not...
-
Discuss how efficiency and effectiveness are used to aid in decision making within a healthcareorganization. Is one more important than the other? Describe the importance of financial information in...
-
Why location choice is important for business?
-
Tabitha Andes was just hired as the assistant treasurer of Southside Stores, a specialty chain store company that has nine retail stores concentrated in one metropolitan area. Among other things, the...
-
The L-shaped frame is made from two segments, each of length \(L\) and flexural stiffness \(E I\). Determine the vertical displacement of point \(B\). W C L A B -L-
-
Ready Electronics is facing stiff competition from imported goods. Its operating income margin has been declining steadily for the past several years; the company has been forced to lower prices so...
-
Mindy has a 20-year adjustable rate mortgage with a rate of 3.6% for the first 4 years. The monthly payment is $1,375.01. The amount of the mortgage is $235,000. What is the remaining balance after 4...
-
A next of kin can be a parent or guardian to more than one student. The primary key of the next_of_kin table is nok_id. The primary key of the student table is student_id. Choose the correct option...
-
Find the exact solution to the following equation using the Quadratic Formula. Solve for zero first. 3x2 = 5x-1
-
9 Find the quotient and remainder using synthetic division for x3+8x+20 +22 # +2
-
Combine and simplify. 3 - 3n n(n + 2) - 1 - 4n n(n + 2) , n % -2
-
Find all solutions of the equation algebraically. Check your solutions. (Enter your answers as a comma-separated list.) 121+ 118t2 - 3 = 0 X =
-
A quadratic function f is given. f(x) = 1 - 6x - x2 (a) Express f in standard form. f(x) = x
-
1. Two planes 100km apart are in radio communication. The transmitting plane delivers 3000W of power with an antenna gain of 40 in the direction of the other plane. The power absorbed by the...
-
You've been asked to take over leadership of a group of paralegals that once had a reputation for being a tight-knit, supportive team, but you quickly figure out that this team is in danger of...
-
Define named constants that you could use in Programming Project 6 in Chapter 1. Programming Project 6 Write an JavaFx application that displays the following pattern:
-
Draw a picture of an initially empty data structure, as described in the previous exercise, after adding the numbers 2, 8, 4, and 6, in this order.
-
Write a Java enumeration LetterGrade that represents letter grades A through F, including plus and minus grades. Define a private instance variable to hold a boolean value that is true if the grade...
-
Using data from a random sample of elementary schools, a researcher regresses average test scores on the fraction of students who qualify for reduced-price meals. The regression indicates a negative...
-
In the study of cigarette demand in this chapter, suppose we used as an instrument the number of trees per capita in the state. Is this instrument relevant? Is it exogenous? Is it a valid instrument?
-
In the demand curve model of Equation (12.3), is \(\ln \left(P_{i}^{\text {butter }} ight)\) positively or negatively correlated with the error, \(u_{i}\) ? If \(\beta_{1}\) is estimated by OLS,...
Study smarter with the SolutionInn App