106: --
107: Begin
108: hr_utility.set_location('Entering:'||l_proc, 5);
109: --
110: If (p_constraint_name = 'OTA_ACTIVITY_DEFINITIONS_FK1') Then
111: hr_utility.set_message(801, 'HR_6153_ALL_PROCEDURE_FAIL');
112: hr_utility.set_message_token('PROCEDURE', l_proc);
113: hr_utility.set_message_token('STEP','5');
114: hr_utility.raise_error;
175: v_proc varchar2(72) := g_package||'check_unique_name';
176: --
177: cursor sel_unique_name is
178: select 'Y'
179: from ota_activity_definitions_vl tad
180: where tad.name = p_name
181: and tad.business_group_id = p_business_group_id
182: and (p_activity_id is null or tad.activity_id <> p_activity_id);
183: --
220: ,p_business_group_id in number
221: )
222: Return number is
223: --
224: v_activity_id ota_activity_definitions.activity_id%TYPE ;
225: v_proc varchar2(72) := g_package||'get_activity_id';
226: --
227: cursor sel_activity_id is
228: select activity_id
225: v_proc varchar2(72) := g_package||'get_activity_id';
226: --
227: cursor sel_activity_id is
228: select activity_id
229: from ota_activity_definitions_vl tad
230: where tad.name = p_name
231: and tad.business_group_id = p_business_group_id;
232: --
233: Begin
629: p_rec.object_version_number := 1; -- Initialise the object version
630: --
631: g_api_dml := true; -- Set the api dml status
632: --
633: -- Insert the row into: ota_activity_definitions
634: --
635: insert into ota_activity_definitions
636: ( activity_id,
637: business_group_id,
631: g_api_dml := true; -- Set the api dml status
632: --
633: -- Insert the row into: ota_activity_definitions
634: --
635: insert into ota_activity_definitions
636: ( activity_id,
637: business_group_id,
638: name,
639: comments,
767: p_rec.object_version_number := p_rec.object_version_number + 1;
768: --
769: g_api_dml := true; -- Set the api dml status
770: --
771: -- Update the ota_activity_definitions Row
772: --
773: update ota_activity_definitions
774: set
775: activity_id = p_rec.activity_id,
769: g_api_dml := true; -- Set the api dml status
770: --
771: -- Update the ota_activity_definitions Row
772: --
773: update ota_activity_definitions
774: set
775: activity_id = p_rec.activity_id,
776: business_group_id = p_rec.business_group_id,
777: name = p_rec.name,
870: hr_utility.set_location('Entering:'||l_proc, 5);
871: --
872: g_api_dml := true; -- Set the api dml status
873: --
874: -- Delete the ota_activity_definitions row.
875: --
876: delete from ota_activity_definitions
877: where activity_id = p_rec.activity_id;
878: --
872: g_api_dml := true; -- Set the api dml status
873: --
874: -- Delete the ota_activity_definitions row.
875: --
876: delete from ota_activity_definitions
877: where activity_id = p_rec.activity_id;
878: --
879: g_api_dml := false; -- Unset the api dml status
880: --
939: Procedure pre_insert(p_rec in out nocopy g_rec_type) is
940: --
941: l_proc varchar2(72) := g_package||'pre_insert';
942: --
943: Cursor C_Sel1 is select ota_activity_definitions_s.nextval from sys.dual;
944: --
945: Begin
946: hr_utility.set_location('Entering:'||l_proc, 5);
947: --
1232: tad_information18,
1233: tad_information19,
1234: tad_information20,
1235: category_usage_id
1236: from ota_activity_definitions
1237: where activity_id = p_activity_id
1238: and object_version_number + 0 = p_object_version_number
1239: for update nowait;
1240: --
1259: -- b) The row is NOT current (i.e. failure on the object version).
1260: --
1261: Close C_Sel1;
1262: hr_utility.set_message(801, 'HR_7155_OBJECT_INVALID');
1263: hr_utility.set_message_token('TABLE_NAME', 'ota_activity_definitions');
1264: hr_utility.raise_error;
1265: End If;
1266: Close C_Sel1;
1267: --
1275: -- The object is locked therefore we need to supply a meaningful
1276: -- error message.
1277: --
1278: hr_utility.set_message(801, 'HR_7165_OBJECT_LOCKED');
1279: hr_utility.set_message_token('TABLE_NAME', 'ota_activity_definitions');
1280: hr_utility.raise_error;
1281: End lck;
1282: --
1283: -- ----------------------------------------------------------------------------