 
 END;
 /
-DELETE FROM KRMS_AGENDA_ATTR_T WHERE AGENDA_ID IN (SELECT AGENDA_ID FROM KRMS_AGENDA_ITM_T WHERE RULE_ID IN ( SELECT RULE_ID FROM KRMS_RULE_T WHERE typ_id IN ( SELECT typ_id FROM krms_typ_t WHERE nm = 'Route to PeopleFlow') ))
-/
-DELETE FROM KRMS_AGENDA_T WHERE AGENDA_ID IN (SELECT AGENDA_ID FROM KRMS_AGENDA_ITM_T WHERE RULE_ID IN ( SELECT RULE_ID FROM KRMS_RULE_T WHERE typ_id IN ( SELECT typ_id FROM krms_typ_t WHERE nm = 'Route to PeopleFlow') ))
-/
-DELETE FROM KRMS_AGENDA_ITM_T WHERE RULE_ID IN ( SELECT RULE_ID FROM KRMS_RULE_T WHERE typ_id IN ( SELECT typ_id FROM krms_typ_t WHERE nm = 'Route to PeopleFlow') )
+DELETE FROM KRMS_AGENDA_ATTR_T WHERE AGENDA_ID IN (SELECT AGENDA_ID FROM KRMS_AGENDA_ITM_T WHERE RULE_ID IN ( SELECT RULE_ID FROM KRMS_ACTN_T WHERE typ_id IN ( SELECT typ_id FROM krms_typ_t WHERE nm = 'Route to PeopleFlow') ))
+/
+DELETE FROM KRMS_AGENDA_T WHERE AGENDA_ID IN (SELECT AGENDA_ID FROM KRMS_AGENDA_ITM_T WHERE RULE_ID IN ( SELECT RULE_ID FROM KRMS_ACTN_T WHERE typ_id IN ( SELECT typ_id FROM krms_typ_t WHERE nm = 'Route to PeopleFlow') ))
+/
+DELETE FROM KRMS_AGENDA_ITM_T WHERE RULE_ID IN ( SELECT RULE_ID FROM KRMS_ACTN_T WHERE typ_id IN ( SELECT typ_id FROM krms_typ_t WHERE nm = 'Route to PeopleFlow') )
 /
 DECLARE
 	cursor c_data is
 	select t2.agenda_id, t1.rule_id from KRMS_AGENDA_ITM_T t1 inner join KRMS_AGENDA_T t2 on t1.AGENDA_ID = t2.AGENDA_ID
-	where t1.RULE_ID in ( SELECT RULE_ID FROM KRMS_RULE_T WHERE typ_id IN ( SELECT typ_id FROM krms_typ_t WHERE nm = 'Route to PeopleFlow') );	
+	where t1.RULE_ID in ( SELECT RULE_ID FROM KRMS_ACTN_T WHERE typ_id IN ( SELECT typ_id FROM krms_typ_t WHERE nm = 'Route to PeopleFlow') );	
 	r_data c_data%rowtype;	
 	ls_seq KRMS_AGENDA_T.AGENDA_ID%type;
 


DECLARE
	cursor c_data is
	SELECT PROP_ID,RULE_ID FROM KRMS_PROP_T@KC_STAG_DB_LINK
	WHERE RULE_ID in ( SELECT RULE_ID FROM KRMS_RULE_T WHERE typ_id IN ( SELECT typ_id FROM krms_typ_t WHERE nm = 'Route to PeopleFlow') );
	r_data c_data%rowtype;
	ls_seq KRMS_PROP_T.PROP_ID%type;


DECLARE
	cursor c_data is
	SELECT RULE_ID,PROP_ID FROM KRMS_RULE_T@KC_STAG_DB_LINK
	WHERE RULE_ID IN ( SELECT RULE_ID FROM KRMS_ACTN_T WHERE typ_id IN ( SELECT typ_id FROM krms_typ_t WHERE nm = 'Route to PeopleFlow') );
	r_data c_data%rowtype;
	
	ls_seq KRMS_RULE_T.RULE_ID%type;
