week 3 Ilab - CREATE OR REPLACE PROCEDURE movie_rental_sp...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 CREATE OR REPLACE PROCEDURE movie_rental_sp (p_mem_id IN mm_rental.member_id%TYPE, p_mov_id IN mm_rental.movie_id%TYPE, p_pay IN mm_rental.payment_methods_id%TYPE) IS v_new_id mm_rental.rental_id%TYPE v_count NUMBER BEGIN SELECT MAX( rental_id ) INTO v_new_id FROM mm_rental v_new_id := v_new_id +1 INSERT INTO mm_rental VALUES ( v_new_id, p_mem_id, p_mov_id, SYSDATE, NULL, p_pay ) RETURN 0 EXCEPTION WHEN OTHERS THEN RETURN 1 END / CREATE OR REPLACE FUNCTION check_memberinfo_sp ( p_membrid IN mm_member.member_id%TYPE, p_paymeth IN mm_pay_type.payment_methods_id%TYPE ) RETURN NUMBER IS BEGIN SELECT COUNT (member_id), COUNT (payment_methods_id) INTO membrid_return, paymeth_return FROM mm_member, mm_pay_type WHERE member_id = p_membrid AND payment_methods_id = p_paymeth RETURN 0 EXCEPTION WHEN OTHERS THEN RETURN 1 END / CREATE OR REPLACE FUNCTION check_movieinfo_sp ( p_movieid IN mm_movie.movie_id%TYPE,
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.

This note was uploaded on 06/11/2011 for the course DBM 405 taught by Professor Panja during the Spring '11 term at DeVry Columbus North.

Page1 / 4

week 3 Ilab - CREATE OR REPLACE PROCEDURE movie_rental_sp...

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