Question
Oracle 11g: PL/SQL Programming 2e, Assignment 7-10 Modify the package created in Assignment 7-9 as follows (provided below) - Add a procedure name dd_plist_pp that
Oracle 11g: PL/SQL Programming 2e, Assignment 7-10
Modify the package created in Assignment 7-9 as follows (provided below)
- Add a procedure name dd_plist_pp that displays the donor name and all associated pledges (including pledge ID, first payment due date, and last payment due date). A donor ID is the input value fo rthe procedure.
- Make the procdure public and the two functions private.
Test with anonymous block.
My code for 7-9:
create or replace PACKAGE pledge_pkg IS FUNCTION dd_paydate1_pf (p_idpledge IN NUMBER) RETURN DATE;
FUNCTION dd_payend_pf (p_idpledge IN NUMBER) RETURN DATE; END; CREATE OR REPLACE PACKAGE BODY PLEDGE_PKG AS
FUNCTION dd_paydate1_pf (p_idpledge IN NUMBER) RETURN DATE AS lv_paydate_date dd_pledge.pledgedate%TYPE; BEGIN SELECT ADD_MONTHS(pledgedate,1) INTO lv_paydate_date FROM dd_pledge WHERE idpledge = p_idpledge; RETURN lv_paydate_date; END dd_paydate1_pf;
FUNCTION dd_payend_pf (p_idpledge IN NUMBER) RETURN DATE AS lv_paymonths_num dd_pledge.paymonths%TYPE; lv_end_date DATE; BEGIN SELECT paymonths INTO lv_paymonths_num FROM dd_pledge WHERE idpledge = p_idpledge;
IF lv_paymonths_num = 0 THEN lv_end_date := dd_paydate1_sf(p_idpledge); ELSE lv_end_date := ADD_MONTHS(dd_paydate1_sf(p_idpledge),lv_paymonths_num); END IF; RETURN lv_end_date; END dd_payend_pf;
END PLEDGE_PKG;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started