[Home] [Help]
21: end Move_To_History;
22:
23: --
24: -- procedure Item_Activity_Statuses
25: -- Delete from wf_item_activity_statuses and wf_item_activity_statuses_h
26: -- where end_date before argument.
27: -- IN:
28: -- itemtype - Item type to delete, or null for all itemtypes
29: -- itemkey - Item key to delete, or null for all itemkeys
333: where SIG_OBJ_TYPE = 'WF_NTF'
334: and SIG_OBJ_ID = WN.NOTIFICATION_ID))
335: union all
336: select WN.NOTIFICATION_ID
337: from WF_ITEM_ACTIVITY_STATUSES_H WIASH,
338: WF_NOTIFICATIONS WN
339: where WIASH.ITEM_TYPE = l_itemtypeTAB(j)
340: and WIASH.ITEM_KEY = l_itemkeyTAB(j)
341: and WIASH.NOTIFICATION_ID = WN.GROUP_ID
412:
413: begin
414: --delete all status history.
415: FORALL j IN l_itemkeyTAB.FIRST..l_itemkeyTAB.LAST
416: delete from WF_ITEM_ACTIVITY_STATUSES_H
417: where ITEM_TYPE = l_itemtypeTAB(j)
418: and ITEM_KEY = l_itemkeyTAB(j);
419:
420: --delete all statuses.
1023: from WF_ITEM_ACTIVITY_STATUSES WIAS
1024: where WIAS.NOTIFICATION_ID = WN.GROUP_ID)
1025: and not exists
1026: (select NULL
1027: from WF_ITEM_ACTIVITY_STATUSES_H WIAS
1028: where WIAS.NOTIFICATION_ID = WN.GROUP_ID)
1029: and (
1030: exists(
1031: select null
1053: from WF_ITEM_ACTIVITY_STATUSES WIAS
1054: where WIAS.NOTIFICATION_ID = WN.GROUP_ID)
1055: and not exists
1056: (select NULL
1057: from WF_ITEM_ACTIVITY_STATUSES_H WIAS
1058: where WIAS.NOTIFICATION_ID = WN.GROUP_ID)
1059: and (
1060: exists(
1061: select null
1106: FROM wf_item_activity_statuses wias
1107: WHERE wias.notification_id = wn.group_id)
1108: AND NOT EXISTS
1109: (SELECT NULL
1110: FROM wf_item_activity_statuses_h wiash
1111: WHERE wiash.notification_id = wn.group_id)
1112: AND wn.end_date is null
1113: AND wn.begin_date <= enddate
1114: AND rownum < Wf_Purge.Commit_Frequency;