Ilab 4 Joel Hernandez - REATE OR REPLACE PACKAGE...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 REATE OR REPLACE PACKAGE mm_rentals_pkg IS PROCEDURE movie_rent_sp (p_movie_id IN mm_movie.movie_id%TYPE, p_member_id IN mm_rental.member_id%TYPE, p_payment_id IN mm_pay_type.payment_methods_id%TYPE) PROCEDURE movie_return_sp (p_rental_id mm_rental.rental_id%TYPE) FUNCTION movie_stock_sf (p_movie_id IN mm_movie.movie_id%TYPE) RETURN VARCHAR2 END / CREATE OR REPLACE PACKAGE BODY MM_RENTAL_PKG IS PROCEDURE movie_rent_sp (p_movie_id IN mm_movie.movie_id%TYPE, p_member_id IN mm_rental.member_id%TYPE, p_payment_id IN mm_pay_type.payment_methods_id%TYPE) IS v_count NUMBER v_movie NUMBER v_member NUMBER v_payment NUMBER BEGIN SELECT MAX(rental_id) INTO v_count FROM mm_rental SELECT COUNT(movie_id) INTO v_movie FROM mm_movie WHERE movie_id = p_movie_id SELECT COUNT(member_id) INTO v_member FROM mm_member WHERE member_id = p_member_id SELECT COUNT(payment_methods_id) INTO v_payment FROM mm_pay_type WHERE payment_methods_id = p_payment_id If v_movie = 0 THEN DBMS_OUTPUT.PUT_LINE('Movie ID is invalid') ELSE
Image of page 1

Info iconThis 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