DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGW_ORG_MAPS_ALL_PKG

Source


1 PACKAGE BODY IGW_ORG_MAPS_ALL_PKG as
2 --$Header: igwstmpb.pls 115.4 2002/11/14 18:47:47 vmedikon ship $
3 
4   procedure insert_row (
5          x_rowid		IN OUT NOCOPY  VARCHAR2
6 	,p_map_id	        NUMBER
7 	,p_organization_id	NUMBER
8 	,p_description		VARCHAR2
9   	,p_start_date_active	DATE
10   	,p_end_date_active	DATE) is
11 
12     cursor  c is
13     select  rowid
14     from    igw_org_maps_all
15     where   map_id = p_map_id;
16 
17     l_last_updated_by  	NUMBER := FND_GLOBAL.USER_ID;
18     l_last_update_login NUMBER := FND_GLOBAL.LOGIN_ID;
19     l_last_update_date  DATE   := SYSDATE;
20   begin
21 
22     insert into igw_org_maps_all(
23 	map_id
24 	,organization_id
25 	,description
26   	,start_date_active
27   	,end_date_active
28 	,last_update_date
29 	,last_updated_by
30 	,creation_date
31 	,created_by
32 	,last_update_login)
33     values(
34 	p_map_id
35 	,p_organization_id
36 	,p_description
37   	,p_start_date_active
38   	,p_end_date_active
39 	,l_last_update_date
40 	,l_last_updated_by
41 	,l_last_update_date
42 	,l_last_updated_by
43 	,l_last_update_login);
44 
45     open c;
46     fetch c into x_ROWID;
47     if (c%notfound) then
48       close c;
49       raise no_data_found;
50     end if;
51     close c;
52   end insert_row;
53 
54 
55   procedure lock_row (
56          x_rowid		VARCHAR2
57 	,p_map_id	        NUMBER
58 	,p_organization_id	NUMBER
59 	,p_description		VARCHAR2
60   	,p_start_date_active	DATE
61   	,p_end_date_active	DATE) is
62 
63     cursor c is
64       select  	*
65      from  	igw_org_maps_all
66      where 	rowid = x_rowid
67      for update of map_id nowait;
68 
69      tlinfo c%rowtype;
70   begin
71     open c;
72     fetch c into tlinfo;
73     if (c%notfound) then
74       fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
75       app_exception.raise_exception;
76       close c;
77       return;
78     end if;
79     close c;
80 
81     if ( (tlinfo.map_id = p_map_id)
82         AND (tlinfo.organization_id = p_organization_id)
83         AND (tlinfo.description = p_description)
84         AND (tlinfo.start_date_active = p_start_date_active)
85         AND ((tlinfo.end_date_active = p_end_date_active)
86            OR ((tlinfo.end_date_active is null)
87                AND (p_end_date_active is null)))
88    ) then
89       null;
90     else
91       fnd_message.set_name('FND', 'FORM_RECORD_CHANGED');
92       app_exception.raise_exception;
93     end if;
94     return;
95   end lock_row;
96 
97   procedure update_row (
98          x_rowid		VARCHAR2
99 	,p_map_id	        NUMBER
100 	,p_organization_id	NUMBER
101 	,p_description		VARCHAR2
102   	,p_start_date_active	DATE
103   	,p_end_date_active	DATE) is
104 
105     l_last_updated_by  	NUMBER := FND_GLOBAL.USER_ID;
106     l_last_update_login NUMBER := FND_GLOBAL.LOGIN_ID;
107     l_last_update_date  DATE   := SYSDATE;
108   begin
109 
110     update igw_org_maps_all
111     set	   organization_id = p_organization_id
112     ,	   description = p_description
113     ,	   start_date_active = p_start_date_active
114     ,	   end_date_active = p_end_date_active
115     ,      last_update_date = l_last_update_date
116     ,      last_updated_by = l_last_updated_by
117     ,      last_update_login = l_last_update_login
118     where  rowid  = x_rowid;
119 
120     if (sql%notfound) then
121       raise no_data_found;
122     end if;
123   end update_row;
124 
125 
126   procedure delete_row (x_rowid	VARCHAR2) is
127   begin
128 
129     delete from igw_org_maps_all
130     where rowid = x_rowid;
131     if (sql%notfound) then
132       raise no_data_found;
133     end if;
134 
135   end delete_row;
136 
137 END IGW_ORG_MAPS_ALL_PKG;