DECLARE
pledgeid dd_pledge.idpledge%TYPE;
amtpledge dd_pledge.pledgeamt%TYPE;
monthspay dd_pledge.paymonths%TYPE;
datepay dd_payment.paydate%TYPE;
amtpay dd_payment.payamt%TYPE;
donorid dd_pledge.iddonor%TYPE;
CURSOR cur_pledges IS
SELECT pl.idpledge, pl.pledgeamt, pl.paymonths, pay.paydate, pay.payamt, pl.iddonor
FROM dd_pledge pl JOIN dd_payment pay
ON pl.idpledge = pay.idpledge
WHERE pl.iddonor = 309
ORDER BY pl.idpledge, pay.paydate;
BEGIN
OPEN cur_pledges;
LOOP
FETCH cur_pledges INTO pledgeid, amtpledge, monthspay, datepay, amtpay, donorid;
DBMS_OUTPUT.PUT_LINE('Pledge ID: '|| pledgeid || ' Pledge Amount: '|| amtpledge || ' Monthly Payments: '|| monthspay || ' Payment Date: '|| datepay || ' Amount Paid: '|| amtpay );
EXIT WHEN cur_pledges%NOTFOUND;
END LOOP;
CLOSE cur_pledges;
END;
请帮忙!!!我无法弄清楚如何为首次付款提供消息