Hi all,
In order to create this trigger, i've created a function to calculate and return business days.
---------------------------------------------------------------------------
FUNCTION CME.CASE_1 (start_date IN CME_ROUT.BFDATE%TYPE, end_date IN CME_ROUT.RETDATE%TYPE)
---------------------------------------------------------------------------
then, i've created a view that calls the above function as follows
---------------------------------------------------------------------------
VIEW CME.TESTCASE_1 (DOC, BUS) AS
SELECT a.docket, SUM(CME.CASE_1(b.BFDATE, b.RETDATE)) AS BUS
from CME.CME_MASTER a, CME.CME_ROUT b
where a.masid = b.masid and
a.closed is not null and
bfdate is not null and
b.retdate > b.bfdate
group by a.docket
---------------------------------------------------------------------------
Since i can't call the above view into a trigger, i'll need to create a procedure and in turn call that procedure into the trigger.
This is what i need to do.
i will need to compare if DOC from the view is equal to the DOC from CME_MASTER table, then if so i would need to put the BUS from the view into field5 in the CME_MASTER table.
this is what i have for procedure, i'm not sure if this is correct nor how to call this procedure into the trigger and make it work.
-------------------------------
procedure CME.CREATE_PROC
AS bus1 number;
begin
select b.bus
into bus1 from CME.CME_MASTER a, CME.TESTCASE_1 b
where a.doc = b.doc;
end;
------------------------------
Please help.
Thank you.