{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lab05_code - spool F\Desktop\DBM405A\lab05_output-Step 1...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
spool F:\Desktop\DBM405A\lab05_output.txt --Step 1: Creating the First Trigger create or replace trigger RENTING_MOVIE after insert on mm_rental for each row BEGIN update mm_movie set movie_qty=movie_qty-1 where movie_id=:old.movie_id; END RENTING_MOVIE; / --Step 2: Creating the Second Trigger create or replace trigger RETURNING_MOVIE after update on mm_rental for each row BEGIN update mm_movie set movie_qty=movie_qty+1 where movie_id=:old.movie_id; END RETURNING_MOVIE; / --Step 3: Modifying the Package Code create or replace package MM_RENTALS_PKG AS procedure MOVIE_RENTAL_SP ( P_MOVIE_ID NUMBER, P_MEMBER_ID NUMBER, P_PAYMENT_METHODS_ID NUMBER ); procedure MOVIE_RETURN_SP (p_rental_id NUMBER); function MOVIE_STOCK_SF (p_movie_id NUMBER) RETURN VARCHAR2; END MM_RENTALS_PKG; / create or replace package body MM_RENTALS_PKG AS procedure MOVIE_RENTAL_SP ( P_MOVIE_ID NUMBER, P_MEMBER_ID NUMBER, P_PAYMENT_METHODS_ID NUMBER ) AS count_movie_id NUMBER; count_member_id NUMBER; count_payments NUMBER; count_movie_qty NUMBER; UNKNOWN_MOVIE EXCEPTION; UNKNOWN_MEMBER EXCEPTION; UNKNOWN_PAYMENT EXCEPTION; UNAVAILABLE_MOVIE EXCEPTION; BEGIN
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern