Activity 2 PL/SQL Exercise PL/SQL Block, Cursors

Activity 2 PL/SQL Exercise PL/SQL Block, Cursors

<p> PLSQL Exercises Patricia Ward ‘Database Management Systems’ 2nd edition Cengage Learning/Middlesex University Press</p><p>Exercise 1 – PL/SQL block, cursors, stored functions</p><p>1. Write a PL/SQL block which includes a procedure getCleanerDetails which accepts a cleaner number and returns the cleaners name and salary. The main block should call the procedure with cleaner number ‘113’ and output this cleaner’s details including the salary which has been increased by 10%. </p><p>Run it from iSQL*PLUS or other Oracle interface. Don’t forget to type the command ‘set serveroutput on’ before executing the code. This is only required to be entered once per session.</p><p>2. Now rewrite question 1) so all cleaners in the Cleaner table have their information displayed with their salaries increased by 10%. The main block now includes a cursor ‘cleanerCursor’ which allows the processing of multiple rows returned by a query. Run this block from iSQL*PLUS or other Oracle interface.</p><p>3. Create a stored function called getCleanersLocation. This function takes as input a cleaner’s number and returns the cleaner’s depot address. Call the function from within an SQL statement to select the cleaner’s name and location for a particular cleaner.</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us