Hi Experts,
my requirement is following.
I have the following tables
ACCOUNT EXPENSE Person Config
Acc_id(pk) Exp_id(pk) person_id(pk) id
Acc_type_id (fk to a config table) exp_type_id (fk to config table) name description
Contribution Amount value
person_id (Fk to Person) person_id (fk to person)
My requirement is to create a trigger which will update the amount column of expense for a particular exp_type_id with the sum values of contributions from account for some acc_type_id.The update statement is as follows
update expense se
set se.amount=(select sum(sa.contributions) from account sa
where sa.account_type in (54,57,58)
and sa.person_id=se.person_id)
where se.expense_item_id=2
and se.person_id=3
I have hardcoded the person_id for testing.but this person_id should be a variable
I need to create a trigger to implement this.Please help
Regards,
Aparna