I'm new to PL/SQL and Oracle Form Builder so, pardon my ignorance. I have three relations DEBTOR, LIST and REGISTRATION. I have described these below:
DEPTOR- debtorID (PK) | firstname | surname | address | postcode
LIST- dCode (PK) | name | fee | description |
REGISTRATION- regID (PK) | debtorID* | dCode* | approvedBy
I have a non-database item called DEBT_FEE which display LIST.fee on my REGISTRATION form. I used a WHEN-NEW-ITEM-INSTANCE trigger to do this.
DECLARE
V_FEE NUMBER(5, 2);
BEGIN
SELECT FEE INTO V_FEE FROM LIST
WHERE :REGISTRATION.DCODE = MODULE.DCODE;
:DEBT_FEE:= V_FEE;
END;
I was wondering how I could do something similar to get the sum of all the debts the current debtor owes. Any help would be appreciated.