(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
View Answer
Unlock this answer now
Get Access to more Verified Answers free of charge
Q8: Write SQL*Plus commands to do the following:
Q9: Assume that the following table is created
Q10: What is a sequence? Write an SQL
Q11: (a) What is a 'table' and what
Q12: (a) What is a named block
Q13: Assuming that a single-row form is
Q14: Oracle database consists of logical and physical
Q15: State the three primary uses of Oracle
Q16: (a)SQL*Plus environment variables are set to
Q18: (a) What is a SQL*Plus script? Why
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents