Ilab 4 Joel Hernandez

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

Info iconThis 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')
Background image of page 1

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

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

Page1 / 3

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online