Create a PL/SQL procedure object in your schema. Using a Cursor the procedure code should be able to retrieve records of all employees and check in which city they live. If an employee lives in Glasgow the procedure should insert a record in the table GlasgowEmployees.

Assume that the following tables are part of a Library database system
Employee(empNo, fName, lName, street, city, sex, salary, libName)
GlasgowEmployees(gEmpNo, fName, lName, sex, salary)


CREATE OR REPLACE PROCEDURE Glasgow_Members
IS
-- Declare a Cursor
CURSOR C1 IS
SELECT * FROM Employee;
BEGIN
FOR emp_rec IN C1 LOOP
IF (emp_rec.city = 'Glasgow') THEN
INSERT INTO GlasgowEmployees values (emp_rec.empNo,
emp_rec.fName, emp_rec.lName, emp_rec.sex, emp_rec.salary);
END IF;
END LOOP;
END;

Computer Science & Information Technology

You might also like to view...

Which of the following does the C++ compiler not examine in order to select the proper overloaded function to call?

a. Types and order of the arguments in the function call. b. The number of arguments in the function call. c. The return type of the function. d. It examines all of the above.

Computer Science & Information Technology

What is the search path for a shell? What is the name of the shell variable that is used to maintain the search path for the Bourne Again and TC shell? Where (in which file) is this variable typically located? What is the search path set to in your environment? How did you find out? Set your search path so that your shell searches your current and your ~/bin directories while looking for a command that you type. In what order does your shell search the directories in your search path? Why?

What will be an ideal response?

Computer Science & Information Technology

What is the easiest way to synch your phone wirelessly?

A) A cloud service B) Bluetooth C) A secure digital transmission D) HDMI

Computer Science & Information Technology

Once a video is placed in a frame, it cannot be resized.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology