`I need to modify the existing procedure. I have a varray type of collection. The data that will be inputted via screen needs to be inserted in ALLOWANCE_HIST table.
The program refers on the following tables named ALLOWANCE AND FEE_DETAILS `
ALLOWANCE - ALIAS (A)
MONTHLY_ALLOWANCE NUMBER
START_DATE DATE
END_DATE DATE
PERSON_ID NUMBER
FEE_DETAILS - ALIAS (B)
PERSON_ID NUMBER
PERCENTAGE NUMBER
START_DATE DATE
END_DATE DATE
`Via screen, a person_id will input a specific date/period for their allowance subsidy application and the fixed monthly allowance is 10,000/month. Now, there's another screen and it's holding the data from table FEE_DETAILS . And whenever there's B.percentage (e.g 50%) should be deducted to A.allowance only between B.start_date and B.end_date.
When the person_id applied for allowance subsidy from 01-OCT-2023 to 31-DEC-2023 and then there's B.percentage(e.g 50%) to be deducted from 01-NOV-2023 to 31-DEC-2023. Currently, this what I'm getting/output (which is incorrect)
CURRENT (OUTPUT)
A.START_DATE A.END_DATE A.MONTHLY_ALLOWANCE COMPUTED_ALLOWANCE
01-OCT-2023 31-OCT-2023 10000 5000
01-NOV-2023 30-NOV-2023 10000 5000
01-DEC-2023 31-DEC-2023 10000 5000
there should be no percentage deduction for October 2023, only from November 2023 to December 2023.
I need to get this kind of output to be inserted in another table named: ALLOWANCE_HIST which also be displayed on screen.
EXPECTED (OUTPUT)
A.START_DATE A.END_DATE A.MONTHLY_ALLOWANCE COMPUTED_ALLOWANCE
01-OCT-2023 31-OCT-2023 10000 10000
01-NOV-2023 30-NOV-2023 10000 5000
01-DEC-2023 31-DEC-2023 10000 5000
`
ALLOWANCE_HIST - ALIAS (C)
START_DATE DATE
END_DATE DATE
MONTHLY_ALLOWANCE
COMPUTED_ALLOWANCE