DBA Data[Home] [Help]

PACKAGE BODY: APPS.AMW_PARTY_MERGE_PKG

Source


1 PACKAGE BODY AMW_PARTY_MERGE_PKG AS
2 /* $Header: amwhzmrb.pls 120.1 2006/06/08 15:56:03 yreddy noship $ */
3 /*===========================================================================*/
4 
5 
6 /*----------------------------------------------------------------------------+
7  |
8  | p_entity_name	Name of registered table/entity
9  | p_from_id		Value of PK of the record being merged
10  | x_to_id		Value of the PK of the record to which this record is mapped
11  | p_from_fk_id		Value of the from ID (e.g. Party, Party Site, etc.) when merge is executed
12  | p_to_fk_id		Value of the to ID (e.g. Party, Party Site, etc.) when merge is executed
13  | p_parent_entity_name	Name of parent HZ table (e.g. HZ_PARTIES, HZ_PARTY_SITES)
14  | p_batch_id		ID of the batch
15  | p_batch_party_id	ID of the batch and Party record
16  |-----------------------------------------------------------------------------*/
17 
18   PROCEDURE party_merge
19     (p_entity_name        in  varchar2,
20      p_from_id            in  number,
21      p_to_id              out nocopy number,
22      p_from_fk_id         in  number,
23      p_to_fk_id           in  number,
24      p_parent_entity_name in  varchar2,
25      p_batch_id           in  number,
26      p_batch_party_id     in  number,
27      p_return_status      out nocopy varchar2) is
28 
29 
30   BEGIN
31 
32     p_return_status := FND_API.G_RET_STS_SUCCESS;
33 
34     IF p_entity_name = 'AMW_ASSESSMENTS_B' THEN
35         UPDATE amw_assessments_b
36         SET assessment_owner_id = p_to_fk_id
37         WHERE assessment_owner_id = p_from_fk_id;
38     END IF;
39 
40     IF p_entity_name = 'AMW_CONSTRAINTS_B' THEN
41         UPDATE amw_constraints_b
42         SET entered_by_id = p_to_fk_id
43         WHERE entered_by_id = p_from_fk_id;
44     END IF;
45 
46     IF p_entity_name = 'AMW_CERTIFICATION_B' THEN
47         UPDATE amw_certification_b
48         SET certification_owner_id = p_to_fk_id
49         WHERE certification_owner_id = p_from_fk_id;
50     END IF;
51 
52     IF p_entity_name = 'AMW_VIOLATIONS' THEN
53         UPDATE amw_violations
54         SET requested_by_id = p_to_fk_id
55         WHERE requested_by_id = p_from_fk_id;
56     END IF;
57 
58     IF p_entity_name = 'AMW_AP_EXECUTIONS' THEN
59         UPDATE amw_ap_executions
60         SET executed_by = p_to_fk_id
61         WHERE executed_by = p_from_fk_id;
62     END IF;
63 
64 
65   EXCEPTION
66     when OTHERS then
67       p_return_status :='FND_API.G_RET_STS_ERROR';
68 
69   END party_merge;
70 
71 
72 END AMW_PARTY_MERGE_PKG;