Essay
(a) In PL/SQL what is a Cursor? When do we use an explicit Cursor? What do you do when you declare a Cursor?
(b) Specify the general structure of a named function block.
(c) 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 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.
(d) Invoke the procedure from SQL*Plus.(e) Assume that a single-row form is created on the Member table and you are using it to enter data in the table. State the steps you would take to create a trigger that will fire and insert the next card number in the member record when the record is saved. Specify the type of trigger you will use and write the trigger code. Assume that a sequence generator already exists.
Correct Answer:

Verified
(a) • A cursor is a PL/SQL construct tha...View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Correct Answer:
Verified
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q1: What are the main advantages and disadvantages
Q2: What is a sequence? Write an SQL
Q3: The following tables form part of a
Q4: Consider the following relational schema:<br> <img src="https://d2lvgg3v3hfg70.cloudfront.net/TBE0001/.jpg"
Q5: Assuming that a single-row form is
Q7: The relational schema shown below is part
Q8: (a)SQL*Plus environment variables are set to
Q9: (a) What is a 'table' and what
Q10: Oracle database consists of logical and physical
Q11: A relational database contains details about journeys