114: --
115: exception
116: when app_exception.application_exception then
117: if hr_multi_message.exception_add
118: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.CURRENCY_CODE'
119: ) then
120: hr_utility.set_location(' Leaving:'|| v_proc,70);
121: raise;
122: end if;
140: --
141: exception
142: when app_exception.application_exception then
143: if hr_multi_message.exception_add
144: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.VENDOR_ID'
145: ) then
146: hr_utility.set_location(' Leaving:'|| v_proc,70);
147: raise;
148: end if;
175: --
176: exception
177: when app_exception.application_exception then
178: if hr_multi_message.exception_add
179: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.CURRENCY_CODE'
180: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.BUDGET_COST'
181: ,p_associated_column3 => 'OTA_ACTIVITY_VERSIONS.ACTUAL_COST'
182: ) then
183: hr_utility.set_location(' Leaving:'|| v_proc,70);
176: exception
177: when app_exception.application_exception then
178: if hr_multi_message.exception_add
179: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.CURRENCY_CODE'
180: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.BUDGET_COST'
181: ,p_associated_column3 => 'OTA_ACTIVITY_VERSIONS.ACTUAL_COST'
182: ) then
183: hr_utility.set_location(' Leaving:'|| v_proc,70);
184: raise;
177: when app_exception.application_exception then
178: if hr_multi_message.exception_add
179: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.CURRENCY_CODE'
180: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.BUDGET_COST'
181: ,p_associated_column3 => 'OTA_ACTIVITY_VERSIONS.ACTUAL_COST'
182: ) then
183: hr_utility.set_location(' Leaving:'|| v_proc,70);
184: raise;
185: end if;
213: --
214: exception
215: when app_exception.application_exception then
216: if hr_multi_message.exception_add
217: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.PROFESSIONAL_CREDITS'
218: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.PROFESSIONAL_CREDIT_TYPE'
219: ) then
220: hr_utility.set_location(' Leaving:'|| v_proc,70);
221: raise;
214: exception
215: when app_exception.application_exception then
216: if hr_multi_message.exception_add
217: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.PROFESSIONAL_CREDITS'
218: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.PROFESSIONAL_CREDIT_TYPE'
219: ) then
220: hr_utility.set_location(' Leaving:'|| v_proc,70);
221: raise;
222: end if;
242: --
243: exception
244: when app_exception.application_exception then
245: if hr_multi_message.exception_add
246: (p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.PROFESSIONAL_CREDIT_TYPE'
247: ) then
248: hr_utility.set_location(' Leaving:'|| v_proc,70);
249: raise;
250: end if;
316: where activity_id = p_activity_id;
317: --
318: cursor sel_unique_key is
319: select 'Y'
320: from ota_activity_versions_vl tav
321: , ota_activity_definitions tad
322: where tav.version_name = p_version_name
323: and tav.activity_id = tad.activity_id
324: and (p_activity_version_id is null or
380: v_proc varchar2(72) := g_package||'check_superseding_version';
381: --
382: cursor sel_version is
383: select end_date
384: from ota_activity_versions tav
385: where tav.activity_version_id = p_sup_act_vers_id;
386: --
387: Begin
388: --
443: v_proc varchar2(72) := g_package||'find_overlapping_versions';
444: --
445: cursor find_overlapping_vers is
446: select 1
447: from ota_activity_versions tav1
448: where tav1.activity_id = p_activity_id
449: and exists
450: ( select 1
451: from ota_activity_versions tav2
447: from ota_activity_versions tav1
448: where tav1.activity_id = p_activity_id
449: and exists
450: ( select 1
451: from ota_activity_versions tav2
452: where tav2.activity_id = p_activity_id
453: and tav1.activity_version_id <> tav2.activity_version_id
454: and tav2.start_date between
455: tav1.start_date and nvl(tav1.end_date, hr_general.end_of_time)
551: ,p_version_name in varchar2
552: )
553: Return number is
554: --
555: v_activity_version_id ota_activity_versions.activity_version_id%TYPE ;
556: v_proc varchar2(72) := g_package||'get_activity_version_id';
557: --
558: cursor sel_version_id is
559: select activity_version_id
556: v_proc varchar2(72) := g_package||'get_activity_version_id';
557: --
558: cursor sel_version_id is
559: select activity_version_id
560: from ota_activity_versions_vl tav
561: where tav.activity_id = p_activity_id
562: and tav.version_name = p_version_name;
563:
564: --
613: (
614: p_activity_version_id in number
615: ) Return varchar2 is
616: --
617: v_version_name ota_activity_versions.version_name%TYPE;
618: v_proc varchar2(72) := g_package||'get_activity_version_name';
619: --
620: cursor sel_vers_name is
621: select version_name
618: v_proc varchar2(72) := g_package||'get_activity_version_name';
619: --
620: cursor sel_vers_name is
621: select version_name
622: from ota_activity_versions_tl tav
623: where tav.activity_version_id = p_activity_version_id
624: and tav.language = USERENV('LANG');
625: --
626: Begin
754: end if;
755: exception
756: when app_exception.application_exception then
757: if hr_multi_message.exception_add
758: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
759: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
760: ) then
761: hr_utility.set_location(' Leaving:'|| v_proc,70);
762: raise;
755: exception
756: when app_exception.application_exception then
757: if hr_multi_message.exception_add
758: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
759: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
760: ) then
761: hr_utility.set_location(' Leaving:'|| v_proc,70);
762: raise;
763: end if;
1010: Begin
1011: hr_utility.set_location(' Entering:' || l_proc,10);
1012: --
1013: IF hr_multi_message.no_exclusive_error
1014: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
1015: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
1016: ,p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
1017: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
1018: ) THEN
1011: hr_utility.set_location(' Entering:' || l_proc,10);
1012: --
1013: IF hr_multi_message.no_exclusive_error
1014: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
1015: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
1016: ,p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
1017: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
1018: ) THEN
1019: --
1012: --
1013: IF hr_multi_message.no_exclusive_error
1014: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
1015: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
1016: ,p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
1017: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
1018: ) THEN
1019: --
1020: OPEN cur_cat_start_end_date;
1013: IF hr_multi_message.no_exclusive_error
1014: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
1015: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
1016: ,p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
1017: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
1018: ) THEN
1019: --
1020: OPEN cur_cat_start_end_date;
1021: FETCH cur_cat_start_end_date into l_cat_start_date, l_cat_end_date;
1038: hr_utility.set_location(' Leaving:' || l_proc,10);
1039: Exception
1040: when app_exception.application_exception then
1041: IF hr_multi_message.exception_add
1042: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
1043: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
1044: ) THEN
1045: hr_utility.set_location(' Leaving:'|| l_proc,20);
1046: raise;
1039: Exception
1040: when app_exception.application_exception then
1041: IF hr_multi_message.exception_add
1042: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
1043: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
1044: ) THEN
1045: hr_utility.set_location(' Leaving:'|| l_proc,20);
1046: raise;
1047: END IF;
1395: -- PUBLIC
1396: -- Description:
1397: -- Delete Validation.
1398: -- This activity version may not be deleted if child rows in
1399: -- ota_activity_versions exists where this activity version has superseded
1400: -- another earlier activity version.
1401: --
1402: Procedure check_if_tav_exists
1403: (
1408: v_proc varchar2(72) := g_package||'check_if_tav_exists';
1409: --
1410: cursor sel_tav_exists is
1411: select 'Y'
1412: from ota_activity_versions tav
1413: where tav.superseded_by_act_version_id = p_activity_version_id;
1414: --
1415: Begin
1416: --
1660: v_default_end_date date;
1661: --
1662: cursor sel_versions is
1663: select 'Y'
1664: from ota_activity_versions tav
1665: where tav.activity_id = p_activity_id
1666: and ((tav.activity_version_id <> p_activity_version_id
1667: and p_activity_version_id is not null )
1668: or p_activity_version_id is null)
1809: select tav.activity_version_id
1810: , tav.start_date
1811: , tav.end_date
1812: , tav.object_version_number
1813: from ota_activity_versions tav
1814: , ota_activity_definitions tad
1815: where tad.activity_id = p_activity_id
1816: and tad.multiple_con_versions_flag = 'N'
1817: and tav.activity_id = tad.activity_id
1816: and tad.multiple_con_versions_flag = 'N'
1817: and tav.activity_id = tad.activity_id
1818: and tav.start_date =
1819: (select max(tav2.start_date)
1820: from ota_activity_versions tav2
1821: where tav2.activity_version_id <> p_activity_version_id
1822: and tav2.activity_id = p_activity_id);
1823: --
1824: Begin
1883: v_activity_version_id number;
1884: --
1885: cursor get_versions is
1886: select tav.end_date
1887: from ota_activity_versions tav
1888: , ota_activity_definitions tad
1889: where tav.activity_id = tad.activity_id --p_activity_id
1890: and tad.activity_id = p_activity_id -- Bug 2808274
1891: and tad.multiple_con_versions_flag = 'N'
1937: --
1938: cursor sel_latest_version is
1939: select tav.superseded_by_act_version_id
1940: from ota_activity_definitions tad
1941: , ota_activity_versions tav
1942: where tad.activity_id = p_activity_id
1943: and tad.multiple_con_versions_flag = 'N'
1944: and tav.activity_id = tad.activity_id
1945: and nvl(tav.end_date, hr_api.g_eot) =
1943: and tad.multiple_con_versions_flag = 'N'
1944: and tav.activity_id = tad.activity_id
1945: and nvl(tav.end_date, hr_api.g_eot) =
1946: (select max( nvl(tav2.end_date, hr_api.g_eot))
1947: from ota_activity_versions tav2
1948: where tav2.activity_id = p_activity_id);
1949: --
1950: cursor sel_superseded_act( pc_activity_version_id IN number) is
1951: select 'Y'
1948: where tav2.activity_id = p_activity_id);
1949: --
1950: cursor sel_superseded_act( pc_activity_version_id IN number) is
1951: select 'Y'
1952: from ota_activity_versions tav
1953: where tav.activity_id = p_activity_id
1954: and tav.activity_version_id = pc_activity_version_id ;
1955: --
1956: Begin
2031:
2032: cursor csr_old_inventory is
2033: select inventory_item_id,
2034: organization_id
2035: from ota_activity_versions
2036: where activity_version_id = p_activity_version_id;
2037: --
2038: Begin
2039: --
2083: --
2084: exception
2085: when app_exception.application_exception then
2086: if hr_multi_message.exception_add
2087: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.INVENTORY_ITEM_ID'
2088: ) then
2089: hr_utility.set_location(' Leaving:'|| l_proc,70);
2090: raise;
2091: end if;
2127: cursor csr_old_inventory is
2128: select inventory_item_id,
2129: organization_id
2130: from
2131: ota_activity_versions
2132: where activity_version_id <> p_activity_version_id;
2133:
2134: cursor cur_offerings is
2135: select 1 from ota_offerings off,ota_category_usages cat
2224: --
2225: exception
2226: when app_exception.application_exception then
2227: if hr_multi_message.exception_add
2228: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.INVENTORY_ITEM_ID'
2229: ) then
2230: hr_utility.set_location(' Leaving:'|| l_proc,70);
2231: raise;
2232: end if;
2256: l_exists varchar2(1);
2257:
2258: cursor csr_rco is
2259: select null
2260: from ota_activity_versions
2261: where rco_id = p_rco_id;
2262:
2263: Begin
2264:
2274: hr_utility.set_location('Entering:'||l_proc, 15);
2275: open csr_rco;
2276: fetch csr_rco into l_exists;
2277: if csr_rco%found then
2278: ota_tav_shd.constraint_error(p_constraint_name =>'OTA_ACTIVITY_VERSIONS_UK5');
2279: end if;
2280: close csr_rco;
2281: hr_utility.set_location('Leaving:'||l_proc, 20);
2282: end if;
2283: end if;
2284: exception
2285: when app_exception.application_exception then
2286: if hr_multi_message.exception_add
2287: (p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.RCO_ID'
2288: ) then
2289: hr_utility.set_location(' Leaving:'|| l_proc,70);
2290: raise;
2291: end if;
2333: Begin
2334:
2335: hr_utility.set_location('Entering:'||l_proc, 5);
2336: IF hr_multi_message.no_exclusive_error
2337: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2338: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
2339: ,p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2340: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE' ) THEN
2341:
2334:
2335: hr_utility.set_location('Entering:'||l_proc, 5);
2336: IF hr_multi_message.no_exclusive_error
2337: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2338: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
2339: ,p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2340: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE' ) THEN
2341:
2342: IF (NVL(ota_tav_shd.g_old_rec.start_date, hr_api.g_date) <>
2335: hr_utility.set_location('Entering:'||l_proc, 5);
2336: IF hr_multi_message.no_exclusive_error
2337: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2338: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
2339: ,p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2340: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE' ) THEN
2341:
2342: IF (NVL(ota_tav_shd.g_old_rec.start_date, hr_api.g_date) <>
2343: NVL( p_start_date, hr_api.g_date )) THEN
2336: IF hr_multi_message.no_exclusive_error
2337: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2338: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
2339: ,p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2340: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE' ) THEN
2341:
2342: IF (NVL(ota_tav_shd.g_old_rec.start_date, hr_api.g_date) <>
2343: NVL( p_start_date, hr_api.g_date )) THEN
2344: l_upd_start_date := TRUE;
2522: Begin
2523:
2524: hr_utility.set_location('Entering:'||l_proc, 5);
2525: IF hr_multi_message.no_exclusive_error
2526: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2527: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
2528: ,p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2529: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE' ) THEN
2530:
2523:
2524: hr_utility.set_location('Entering:'||l_proc, 5);
2525: IF hr_multi_message.no_exclusive_error
2526: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2527: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
2528: ,p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2529: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE' ) THEN
2530:
2531: IF (NVL(ota_tav_shd.g_old_rec.start_date, hr_api.g_date) <>
2524: hr_utility.set_location('Entering:'||l_proc, 5);
2525: IF hr_multi_message.no_exclusive_error
2526: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2527: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
2528: ,p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2529: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE' ) THEN
2530:
2531: IF (NVL(ota_tav_shd.g_old_rec.start_date, hr_api.g_date) <>
2532: NVL( p_start_date, hr_api.g_date )) THEN
2525: IF hr_multi_message.no_exclusive_error
2526: (p_check_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2527: ,p_check_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE'
2528: ,p_associated_column1 => 'OTA_ACTIVITY_VERSIONS.START_DATE'
2529: ,p_associated_column2 => 'OTA_ACTIVITY_VERSIONS.END_DATE' ) THEN
2530:
2531: IF (NVL(ota_tav_shd.g_old_rec.start_date, hr_api.g_date) <>
2532: NVL( p_start_date, hr_api.g_date )) THEN
2533: l_upd_start_date := TRUE;