71:
72: -- Initialize message list if p_init_msg_list is set to TRUE.
73: IF FND_API.to_Boolean( p_init_msg_list )
74: THEN
75: FND_MSG_PUB.initialize;
76: END IF;
77:
78: -- Debug Message
79: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
75: FND_MSG_PUB.initialize;
76: END IF;
77:
78: -- Debug Message
79: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
80: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - start');
81: END IF;
82:
83: -- Initialize API return status to SUCCESS
107:
108: IF FND_GLOBAL.User_Id IS NULL
109: THEN
110: FND_MESSAGE.set_name('PV', 'PV_API_USER_PROFILE_MISSING');
111: FND_MSG_PUB.add;
112: RAISE FND_API.G_EXC_ERROR;
113: END IF;
114:
115: IF ( P_validation_level >= FND_API.G_VALID_LEVEL_FULL)
114:
115: IF ( P_validation_level >= FND_API.G_VALID_LEVEL_FULL)
116: THEN
117: -- Debug message
118: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
119: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - Validate_Attr_Principal');
120: end if;
121:
122: --DBMS_OUTPUT.PUT_LINE(l_full_name||' : Before Validate_Attr_Principal' );
150: END IF;
151:
152: --DBMS_OUTPUT.PUT_LINE(l_full_name||' : After Validate' );
153: -- Debug Message
154: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
155: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - Calling create table handler');
156: END IF;
157:
158: -- Invoke table handler(PV_Attr_PrincipalS_PKG.Insert_Row)
187: END IF;
188:
189:
190: -- Debug Message
191: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
192: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - end');
193: END IF;
194:
195: -- Standard call to get message count and if count is 1, get message info.
192: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - end');
193: END IF;
194:
195: -- Standard call to get message count and if count is 1, get message info.
196: FND_MSG_PUB.Count_And_Get
197: (p_count => x_msg_count,
198: p_data => x_msg_data
199: );
200: EXCEPTION
206: WHEN FND_API.G_EXC_ERROR THEN
207: ROLLBACK TO CREATE_Attr_Principal_PVT;
208: x_return_status := FND_API.G_RET_STS_ERROR;
209: -- Standard call to get message count and if count=1, get the message
210: FND_MSG_PUB.Count_And_Get (
211: p_encoded => FND_API.G_FALSE,
212: p_count => x_msg_count,
213: p_data => x_msg_data
214: );
216: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
217: ROLLBACK TO CREATE_Attr_Principal_PVT;
218: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
219: -- Standard call to get message count and if count=1, get the message
220: FND_MSG_PUB.Count_And_Get (
221: p_encoded => FND_API.G_FALSE,
222: p_count => x_msg_count,
223: p_data => x_msg_data
224: );
225:
226: WHEN OTHERS THEN
227: ROLLBACK TO CREATE_Attr_Principal_PVT;
228: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
229: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
230: THEN
231: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
232: END IF;
233: -- Standard call to get message count and if count=1, get the message
227: ROLLBACK TO CREATE_Attr_Principal_PVT;
228: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
229: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
230: THEN
231: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
232: END IF;
233: -- Standard call to get message count and if count=1, get the message
234: FND_MSG_PUB.Count_And_Get (
235: p_encoded => FND_API.G_FALSE,
230: THEN
231: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
232: END IF;
233: -- Standard call to get message count and if count=1, get the message
234: FND_MSG_PUB.Count_And_Get (
235: p_encoded => FND_API.G_FALSE,
236: p_count => x_msg_count,
237: p_data => x_msg_data
238: );
284:
285: -- Initialize message list if p_init_msg_list is set to TRUE.
286: IF FND_API.to_Boolean( p_init_msg_list )
287: THEN
288: FND_MSG_PUB.initialize;
289: END IF;
290:
291: -- Debug Message
292: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
288: FND_MSG_PUB.initialize;
289: END IF;
290:
291: -- Debug Message
292: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
293: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - start');
294: END IF;
295:
296:
297: -- Initialize API return status to SUCCESS
298: x_return_status := FND_API.G_RET_STS_SUCCESS;
299:
300: -- Debug Message
301: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
302: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - Open Cursor to Select');
303: END IF;
304:
305: OPEN c_get_Attr_Principal( l_tar_Attr_Principal_rec.Attr_Principal_id);
306:
307: FETCH c_get_Attr_Principal INTO l_ref_Attr_Principal_rec ;
308:
309: IF ( c_get_Attr_Principal%NOTFOUND) THEN
310: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
311: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_ENTITY');
312: FND_MESSAGE.set_token('MODE','Update');
313: FND_MESSAGE.set_token('ENTITY','Attr_Principal');
314: FND_MESSAGE.set_token('ID',TO_CHAR(l_tar_Attr_Principal_rec.Attr_Principal_id));
311: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_ENTITY');
312: FND_MESSAGE.set_token('MODE','Update');
313: FND_MESSAGE.set_token('ENTITY','Attr_Principal');
314: FND_MESSAGE.set_token('ID',TO_CHAR(l_tar_Attr_Principal_rec.Attr_Principal_id));
315: FND_MSG_PUB.add;
316: END IF;
317: RAISE FND_API.G_EXC_ERROR;
318: END IF;
319: -- Debug Message
316: END IF;
317: RAISE FND_API.G_EXC_ERROR;
318: END IF;
319: -- Debug Message
320: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
321: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - Close Cursor');
322: END IF;
323:
324: CLOSE c_get_Attr_Principal;
327:
328: IF (l_tar_Attr_Principal_rec.object_version_number is NULL or
329: l_tar_Attr_Principal_rec.object_version_number = FND_API.G_MISS_NUM ) Then
330:
331: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
332: FND_MESSAGE.set_name('PV', 'PV_API_VERSION_MISSING');
333: FND_MESSAGE.set_token('COLUMN',TO_CHAR(l_tar_Attr_Principal_rec.last_update_date));
334: FND_MSG_PUB.add;
335: END IF;
330:
331: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
332: FND_MESSAGE.set_name('PV', 'PV_API_VERSION_MISSING');
333: FND_MESSAGE.set_token('COLUMN',TO_CHAR(l_tar_Attr_Principal_rec.last_update_date));
334: FND_MSG_PUB.add;
335: END IF;
336: RAISE FND_API.G_EXC_ERROR;
337: End if;
338:
337: End if;
338:
339: -- Check Whether record has been changed by someone else
340: If (l_tar_Attr_Principal_rec.object_version_number <> l_ref_Attr_Principal_rec.object_version_number) Then
341: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
342: FND_MESSAGE.set_name('PV', 'PV_API_RECORD_CHANGED');
343: FND_MESSAGE.set_token('VALUE','Attr_Principal');
344: FND_MSG_PUB.add;
345: END IF;
340: If (l_tar_Attr_Principal_rec.object_version_number <> l_ref_Attr_Principal_rec.object_version_number) Then
341: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
342: FND_MESSAGE.set_name('PV', 'PV_API_RECORD_CHANGED');
343: FND_MESSAGE.set_token('VALUE','Attr_Principal');
344: FND_MSG_PUB.add;
345: END IF;
346: RAISE FND_API.G_EXC_ERROR;
347: End if;
348: IF ( P_validation_level >= FND_API.G_VALID_LEVEL_FULL)
347: End if;
348: IF ( P_validation_level >= FND_API.G_VALID_LEVEL_FULL)
349: THEN
350: -- Debug message
351: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
352: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - Validate_Attr_Principal');
353: END IF;
354:
355: -- Invoke validation procedures
371: END IF;
372:
373:
374: -- Debug Message
375: --PVX_Utility_PVT.debug_message(FND_MSG_PUB.G_MSG_LVL_ERROR, 'Private API: Calling update table handler');
376: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
377: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - Calling update table handler');
378: END IF;
379:
372:
373:
374: -- Debug Message
375: --PVX_Utility_PVT.debug_message(FND_MSG_PUB.G_MSG_LVL_ERROR, 'Private API: Calling update table handler');
376: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
377: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - Calling update table handler');
378: END IF;
379:
380: -- Invoke table handler(PV_Attr_PrincipalS_PKG.Update_Row)
403: END IF;
404:
405:
406: -- Debug Message
407: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
408: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - end');
409: END IF;
410:
411: -- Standard call to get message count and if count is 1, get message info.
408: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - end');
409: END IF;
410:
411: -- Standard call to get message count and if count is 1, get message info.
412: FND_MSG_PUB.Count_And_Get
413: (p_count => x_msg_count,
414: p_data => x_msg_data
415: );
416: EXCEPTION
422: WHEN FND_API.G_EXC_ERROR THEN
423: ROLLBACK TO UPDATE_Attr_Principal_PVT;
424: x_return_status := FND_API.G_RET_STS_ERROR;
425: -- Standard call to get message count and if count=1, get the message
426: FND_MSG_PUB.Count_And_Get (
427: p_encoded => FND_API.G_FALSE,
428: p_count => x_msg_count,
429: p_data => x_msg_data
430: );
432: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
433: ROLLBACK TO UPDATE_Attr_Principal_PVT;
434: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
435: -- Standard call to get message count and if count=1, get the message
436: FND_MSG_PUB.Count_And_Get (
437: p_encoded => FND_API.G_FALSE,
438: p_count => x_msg_count,
439: p_data => x_msg_data
440: );
441:
442: WHEN OTHERS THEN
443: ROLLBACK TO UPDATE_Attr_Principal_PVT;
444: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
445: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
446: THEN
447: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
448: END IF;
449: -- Standard call to get message count and if count=1, get the message
443: ROLLBACK TO UPDATE_Attr_Principal_PVT;
444: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
445: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
446: THEN
447: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
448: END IF;
449: -- Standard call to get message count and if count=1, get the message
450: FND_MSG_PUB.Count_And_Get (
451: p_encoded => FND_API.G_FALSE,
446: THEN
447: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
448: END IF;
449: -- Standard call to get message count and if count=1, get the message
450: FND_MSG_PUB.Count_And_Get (
451: p_encoded => FND_API.G_FALSE,
452: p_count => x_msg_count,
453: p_data => x_msg_data
454: );
490:
491: -- Initialize message list if p_init_msg_list is set to TRUE.
492: IF FND_API.to_Boolean( p_init_msg_list )
493: THEN
494: FND_MSG_PUB.initialize;
495: END IF;
496:
497: -- Debug Message
498: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
494: FND_MSG_PUB.initialize;
495: END IF;
496:
497: -- Debug Message
498: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
499: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - start');
500: END IF;
501:
502:
506: --
507: -- Api body
508: --
509: -- Debug Message
510: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
511: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - Calling delete table handler');
512: END IF;
513:
514:
526: END IF;
527:
528:
529: -- Debug Message
530: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
531: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - end');
532: END IF;
533:
534: -- Standard call to get message count and if count is 1, get message info.
531: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - end');
532: END IF;
533:
534: -- Standard call to get message count and if count is 1, get message info.
535: FND_MSG_PUB.Count_And_Get
536: (p_count => x_msg_count,
537: p_data => x_msg_data
538: );
539: EXCEPTION
545: WHEN FND_API.G_EXC_ERROR THEN
546: ROLLBACK TO DELETE_Attr_Principal_PVT;
547: x_return_status := FND_API.G_RET_STS_ERROR;
548: -- Standard call to get message count and if count=1, get the message
549: FND_MSG_PUB.Count_And_Get (
550: p_encoded => FND_API.G_FALSE,
551: p_count => x_msg_count,
552: p_data => x_msg_data
553: );
555: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
556: ROLLBACK TO DELETE_Attr_Principal_PVT;
557: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
558: -- Standard call to get message count and if count=1, get the message
559: FND_MSG_PUB.Count_And_Get (
560: p_encoded => FND_API.G_FALSE,
561: p_count => x_msg_count,
562: p_data => x_msg_data
563: );
564:
565: WHEN OTHERS THEN
566: ROLLBACK TO DELETE_Attr_Principal_PVT;
567: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
568: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
569: THEN
570: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
571: END IF;
572: -- Standard call to get message count and if count=1, get the message
566: ROLLBACK TO DELETE_Attr_Principal_PVT;
567: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
568: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
569: THEN
570: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
571: END IF;
572: -- Standard call to get message count and if count=1, get the message
573: FND_MSG_PUB.Count_And_Get (
574: p_encoded => FND_API.G_FALSE,
569: THEN
570: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
571: END IF;
572: -- Standard call to get message count and if count=1, get the message
573: FND_MSG_PUB.Count_And_Get (
574: p_encoded => FND_API.G_FALSE,
575: p_count => x_msg_count,
576: p_data => x_msg_data
577: );
607:
608: BEGIN
609:
610: -- Debug Message
611: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
612: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - start');
613: END IF;
614:
615: -- Initialize message list if p_init_msg_list is set to TRUE.
614:
615: -- Initialize message list if p_init_msg_list is set to TRUE.
616: IF FND_API.to_Boolean( p_init_msg_list )
617: THEN
618: FND_MSG_PUB.initialize;
619: END IF;
620:
621: -- Standard call to check for call compatibility.
622: IF NOT FND_API.Compatible_API_Call ( l_api_version_number,
632: x_return_status := FND_API.G_RET_STS_SUCCESS;
633:
634:
635: ------------------------ lock -------------------------
636: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
637: PVX_Utility_PVT.debug_message(l_full_name||': start');
638: END IF;
639: OPEN c_Attr_Principal;
640:
641: FETCH c_Attr_Principal INTO l_Attr_Principal_ID;
642:
643: IF (c_Attr_Principal%NOTFOUND) THEN
644: CLOSE c_Attr_Principal;
645: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
646: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
647: FND_MESSAGE.set_name('PV', 'PV_API_RECORD_NOT_FOUND');
648: FND_MSG_PUB.add;
649: END IF;
642:
643: IF (c_Attr_Principal%NOTFOUND) THEN
644: CLOSE c_Attr_Principal;
645: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
646: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
647: FND_MESSAGE.set_name('PV', 'PV_API_RECORD_NOT_FOUND');
648: FND_MSG_PUB.add;
649: END IF;
650: END IF;
644: CLOSE c_Attr_Principal;
645: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_error) THEN
646: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
647: FND_MESSAGE.set_name('PV', 'PV_API_RECORD_NOT_FOUND');
648: FND_MSG_PUB.add;
649: END IF;
650: END IF;
651: RAISE FND_API.g_exc_error;
652: END IF;
653:
654: CLOSE c_Attr_Principal;
655:
656: -------------------- finish --------------------------
657: FND_MSG_PUB.count_and_get(
658: p_encoded => FND_API.g_false,
659: p_count => x_msg_count,
660: p_data => x_msg_data);
661: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
657: FND_MSG_PUB.count_and_get(
658: p_encoded => FND_API.g_false,
659: p_count => x_msg_count,
660: p_data => x_msg_data);
661: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
662: PVX_Utility_PVT.debug_message(l_full_name ||': end');
663: END IF;
664: EXCEPTION
665: /*
670: WHEN FND_API.G_EXC_ERROR THEN
671: ROLLBACK TO LOCK_Attr_Principal_PVT;
672: x_return_status := FND_API.G_RET_STS_ERROR;
673: -- Standard call to get message count and if count=1, get the message
674: FND_MSG_PUB.Count_And_Get (
675: p_encoded => FND_API.G_FALSE,
676: p_count => x_msg_count,
677: p_data => x_msg_data
678: );
680: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
681: ROLLBACK TO LOCK_Attr_Principal_PVT;
682: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
683: -- Standard call to get message count and if count=1, get the message
684: FND_MSG_PUB.Count_And_Get (
685: p_encoded => FND_API.G_FALSE,
686: p_count => x_msg_count,
687: p_data => x_msg_data
688: );
689:
690: WHEN OTHERS THEN
691: ROLLBACK TO LOCK_Attr_Principal_PVT;
692: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
693: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
694: THEN
695: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
696: END IF;
697: -- Standard call to get message count and if count=1, get the message
691: ROLLBACK TO LOCK_Attr_Principal_PVT;
692: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
693: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
694: THEN
695: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
696: END IF;
697: -- Standard call to get message count and if count=1, get the message
698: FND_MSG_PUB.Count_And_Get (
699: p_encoded => FND_API.G_FALSE,
694: THEN
695: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
696: END IF;
697: -- Standard call to get message count and if count=1, get the message
698: FND_MSG_PUB.Count_And_Get (
699: p_encoded => FND_API.G_FALSE,
700: p_count => x_msg_count,
701: p_data => x_msg_data
702: );
725: );
726: END IF;
727:
728: IF l_valid_flag = FND_API.g_false THEN
729: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
730: FND_MESSAGE.set_name('PV', 'PV_API_DUPLICATE_ENTITY');
731: FND_MESSAGE.set_token('ID',to_char(p_Attr_Principal_rec.Attr_Principal_ID) );
732: FND_MESSAGE.set_token('ENTITY','Attr_Principal');
733: FND_MSG_PUB.add;
729: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
730: FND_MESSAGE.set_name('PV', 'PV_API_DUPLICATE_ENTITY');
731: FND_MESSAGE.set_token('ID',to_char(p_Attr_Principal_rec.Attr_Principal_ID) );
732: FND_MESSAGE.set_token('ENTITY','Attr_Principal');
733: FND_MSG_PUB.add;
734: END IF;
735: x_return_status := FND_API.g_ret_sts_error;
736: RETURN;
737: END IF;
753: --DBMS_OUTPUT.PUT_LINE('p_Attr_Principal_rec.Attr_Principal_id = '||
754: -- TO_CHAR(p_Attr_Principal_rec.Attr_Principal_id));
755: IF p_Attr_Principal_rec.Attr_Principal_id = FND_API.g_miss_num
756: OR p_Attr_Principal_rec.Attr_Principal_id IS NULL THEN
757: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
758: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
759: FND_MESSAGE.set_token('COLUMN','Attr_Principal_id');
760: FND_MSG_PUB.add;
761: END IF;
756: OR p_Attr_Principal_rec.Attr_Principal_id IS NULL THEN
757: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
758: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
759: FND_MESSAGE.set_token('COLUMN','Attr_Principal_id');
760: FND_MSG_PUB.add;
761: END IF;
762: x_return_status := FND_API.g_ret_sts_error;
763: RETURN;
764: END IF;
764: END IF;
765:
766: IF p_Attr_Principal_rec.last_update_date = FND_API.g_miss_date
767: OR p_Attr_Principal_rec.last_update_date IS NULL THEN
768: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
769: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
770: FND_MESSAGE.set_token('COLUMN','last_update_date');
771: FND_MSG_PUB.add;
772: END IF;
767: OR p_Attr_Principal_rec.last_update_date IS NULL THEN
768: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
769: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
770: FND_MESSAGE.set_token('COLUMN','last_update_date');
771: FND_MSG_PUB.add;
772: END IF;
773: x_return_status := FND_API.g_ret_sts_error;
774: RETURN;
775: END IF;
775: END IF;
776:
777: IF p_Attr_Principal_rec.last_updated_by = FND_API.g_miss_num
778: OR p_Attr_Principal_rec.last_updated_by IS NULL THEN
779: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
780: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
781: FND_MESSAGE.set_token('COLUMN','last_updated_by');
782: FND_MSG_PUB.add;
783: END IF;
778: OR p_Attr_Principal_rec.last_updated_by IS NULL THEN
779: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
780: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
781: FND_MESSAGE.set_token('COLUMN','last_updated_by');
782: FND_MSG_PUB.add;
783: END IF;
784: x_return_status := FND_API.g_ret_sts_error;
785: RETURN;
786: END IF;
786: END IF;
787:
788: IF p_Attr_Principal_rec.creation_date = FND_API.g_miss_date
789: OR p_Attr_Principal_rec.creation_date IS NULL THEN
790: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
791: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
792: FND_MESSAGE.set_token('COLUMN','creation_date');
793: FND_MSG_PUB.add;
794: END IF;
789: OR p_Attr_Principal_rec.creation_date IS NULL THEN
790: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
791: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
792: FND_MESSAGE.set_token('COLUMN','creation_date');
793: FND_MSG_PUB.add;
794: END IF;
795: x_return_status := FND_API.g_ret_sts_error;
796: RETURN;
797: END IF;
797: END IF;
798:
799: IF p_Attr_Principal_rec.created_by = FND_API.g_miss_num
800: OR p_Attr_Principal_rec.created_by IS NULL THEN
801: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
802: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
803: FND_MESSAGE.set_token('COLUMN','created_by');
804: FND_MSG_PUB.add;
805: END IF;
800: OR p_Attr_Principal_rec.created_by IS NULL THEN
801: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
802: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
803: FND_MESSAGE.set_token('COLUMN','created_by');
804: FND_MSG_PUB.add;
805: END IF;
806: x_return_status := FND_API.g_ret_sts_error;
807: RETURN;
808: END IF;
808: END IF;
809:
810: IF p_Attr_Principal_rec.object_version_number = FND_API.g_miss_num
811: OR p_Attr_Principal_rec.object_version_number IS NULL THEN
812: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
813: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
814: FND_MESSAGE.set_token('COLUMN','object_version_number');
815: FND_MSG_PUB.add;
816: END IF;
811: OR p_Attr_Principal_rec.object_version_number IS NULL THEN
812: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
813: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
814: FND_MESSAGE.set_token('COLUMN','object_version_number');
815: FND_MSG_PUB.add;
816: END IF;
817: x_return_status := FND_API.g_ret_sts_error;
818: RETURN;
819: END IF;
821:
822:
823: IF p_Attr_Principal_rec.attribute_id = FND_API.g_miss_num
824: OR p_Attr_Principal_rec.attribute_id IS NULL THEN
825: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
826: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
827: FND_MESSAGE.set_token('COLUMN','attribute_id');
828: FND_MSG_PUB.add;
829: END IF;
824: OR p_Attr_Principal_rec.attribute_id IS NULL THEN
825: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
826: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
827: FND_MESSAGE.set_token('COLUMN','attribute_id');
828: FND_MSG_PUB.add;
829: END IF;
830: x_return_status := FND_API.g_ret_sts_error;
831: RETURN;
832: END IF;
832: END IF;
833:
834: IF p_Attr_Principal_rec.jtf_auth_principal_id = FND_API.g_miss_num
835: OR p_Attr_Principal_rec.jtf_auth_principal_id IS NULL THEN
836: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
837: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
838: FND_MESSAGE.set_token('COLUMN','jtf_auth_principal_id');
839: FND_MSG_PUB.add;
840: END IF;
835: OR p_Attr_Principal_rec.jtf_auth_principal_id IS NULL THEN
836: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
837: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
838: FND_MESSAGE.set_token('COLUMN','jtf_auth_principal_id');
839: FND_MSG_PUB.add;
840: END IF;
841: x_return_status := FND_API.g_ret_sts_error;
842: RETURN;
843: END IF;
843: END IF;
844: ELSE
845:
846: IF p_Attr_Principal_rec.Attr_Principal_id IS NULL THEN
847: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
848: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
849: FND_MESSAGE.set_token('COLUMN','Attr_Principal_id');
850: FND_MSG_PUB.add;
851: END IF;
846: IF p_Attr_Principal_rec.Attr_Principal_id IS NULL THEN
847: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
848: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
849: FND_MESSAGE.set_token('COLUMN','Attr_Principal_id');
850: FND_MSG_PUB.add;
851: END IF;
852: x_return_status := FND_API.g_ret_sts_error;
853: RETURN;
854: END IF;
853: RETURN;
854: END IF;
855:
856: IF p_Attr_Principal_rec.last_update_date IS NULL THEN
857: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
858: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
859: FND_MESSAGE.set_token('COLUMN','last_update_date');
860: FND_MSG_PUB.add;
861: END IF;
856: IF p_Attr_Principal_rec.last_update_date IS NULL THEN
857: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
858: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
859: FND_MESSAGE.set_token('COLUMN','last_update_date');
860: FND_MSG_PUB.add;
861: END IF;
862: x_return_status := FND_API.g_ret_sts_error;
863: RETURN;
864: END IF;
863: RETURN;
864: END IF;
865:
866: IF p_Attr_Principal_rec.last_updated_by IS NULL THEN
867: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
868: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
869: FND_MESSAGE.set_token('COLUMN','last_updated_by');
870: FND_MSG_PUB.add;
871: END IF;
866: IF p_Attr_Principal_rec.last_updated_by IS NULL THEN
867: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
868: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
869: FND_MESSAGE.set_token('COLUMN','last_updated_by');
870: FND_MSG_PUB.add;
871: END IF;
872: x_return_status := FND_API.g_ret_sts_error;
873: RETURN;
874: END IF;
873: RETURN;
874: END IF;
875:
876: IF p_Attr_Principal_rec.creation_date IS NULL THEN
877: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
878: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
879: FND_MESSAGE.set_token('COLUMN','creation_date');
880: FND_MSG_PUB.add;
881: END IF;
876: IF p_Attr_Principal_rec.creation_date IS NULL THEN
877: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
878: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
879: FND_MESSAGE.set_token('COLUMN','creation_date');
880: FND_MSG_PUB.add;
881: END IF;
882: x_return_status := FND_API.g_ret_sts_error;
883: RETURN;
884: END IF;
883: RETURN;
884: END IF;
885:
886: IF p_Attr_Principal_rec.created_by IS NULL THEN
887: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
888: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
889: FND_MESSAGE.set_token('COLUMN','created_by');
890: FND_MSG_PUB.add;
891: END IF;
886: IF p_Attr_Principal_rec.created_by IS NULL THEN
887: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
888: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
889: FND_MESSAGE.set_token('COLUMN','created_by');
890: FND_MSG_PUB.add;
891: END IF;
892: x_return_status := FND_API.g_ret_sts_error;
893: RETURN;
894: END IF;
893: RETURN;
894: END IF;
895:
896: IF p_Attr_Principal_rec.object_version_number IS NULL THEN
897: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
898: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
899: FND_MESSAGE.set_token('COLUMN','object_version_number');
900: FND_MSG_PUB.add;
901: END IF;
896: IF p_Attr_Principal_rec.object_version_number IS NULL THEN
897: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
898: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
899: FND_MESSAGE.set_token('COLUMN','object_version_number');
900: FND_MSG_PUB.add;
901: END IF;
902: x_return_status := FND_API.g_ret_sts_error;
903: RETURN;
904: END IF;
903: RETURN;
904: END IF;
905:
906: IF p_Attr_Principal_rec.attribute_id IS NULL THEN
907: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
908: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
909: FND_MESSAGE.set_token('COLUMN','attribute_id');
910: FND_MSG_PUB.add;
911: END IF;
906: IF p_Attr_Principal_rec.attribute_id IS NULL THEN
907: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
908: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
909: FND_MESSAGE.set_token('COLUMN','attribute_id');
910: FND_MSG_PUB.add;
911: END IF;
912: x_return_status := FND_API.g_ret_sts_error;
913: RETURN;
914: END IF;
913: RETURN;
914: END IF;
915:
916: IF p_Attr_Principal_rec.jtf_auth_principal_id IS NULL THEN
917: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
918: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
919: FND_MESSAGE.set_token('COLUMN','enabled_flag');
920: FND_MSG_PUB.add;
921: END IF;
916: IF p_Attr_Principal_rec.jtf_auth_principal_id IS NULL THEN
917: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
918: FND_MESSAGE.set_name('PV', 'PV_API_MISSING_REQ_COLUMN');
919: FND_MESSAGE.set_token('COLUMN','enabled_flag');
920: FND_MSG_PUB.add;
921: END IF;
922: x_return_status := FND_API.g_ret_sts_error;
923: RETURN;
924: END IF;
1111:
1112: -- Initialize message list if p_init_msg_list is set to TRUE.
1113: IF FND_API.to_Boolean( p_init_msg_list )
1114: THEN
1115: FND_MSG_PUB.initialize;
1116: END IF;
1117: IF p_validation_level >= JTF_PLSQL_API.g_valid_level_item THEN
1118: Check_Attr_Principal_Items(
1119: p_Attr_Principal_rec => p_Attr_Principal_rec
1149: END IF;
1150:
1151:
1152: -- Debug Message
1153: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
1154: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - start');
1155: END IF;
1156:
1157: -- Initialize API return status to SUCCESS
1158: x_return_status := FND_API.G_RET_STS_SUCCESS;
1159:
1160:
1161: -- Debug Message
1162: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
1163: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - end');
1164: END IF;
1165:
1166: -- Standard call to get message count and if count is 1, get message info.
1163: PVX_Utility_PVT.debug_message('Private API: '||l_full_name||' - end');
1164: END IF;
1165:
1166: -- Standard call to get message count and if count is 1, get message info.
1167: FND_MSG_PUB.Count_And_Get
1168: (p_count => x_msg_count,
1169: p_data => x_msg_data
1170: );
1171: EXCEPTION
1177: WHEN FND_API.G_EXC_ERROR THEN
1178: ROLLBACK TO VALIDATE_Attr_Principal;
1179: x_return_status := FND_API.G_RET_STS_ERROR;
1180: -- Standard call to get message count and if count=1, get the message
1181: FND_MSG_PUB.Count_And_Get (
1182: p_encoded => FND_API.G_FALSE,
1183: p_count => x_msg_count,
1184: p_data => x_msg_data
1185: );
1187: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1188: ROLLBACK TO VALIDATE_Attr_Principal;
1189: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1190: -- Standard call to get message count and if count=1, get the message
1191: FND_MSG_PUB.Count_And_Get (
1192: p_encoded => FND_API.G_FALSE,
1193: p_count => x_msg_count,
1194: p_data => x_msg_data
1195: );
1196:
1197: WHEN OTHERS THEN
1198: ROLLBACK TO VALIDATE_Attr_Principal;
1199: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1200: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1201: THEN
1202: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1203: END IF;
1204: -- Standard call to get message count and if count=1, get the message
1198: ROLLBACK TO VALIDATE_Attr_Principal;
1199: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1200: IF FND_MSG_PUB.Check_Msg_Level ( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1201: THEN
1202: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1203: END IF;
1204: -- Standard call to get message count and if count=1, get the message
1205: FND_MSG_PUB.Count_And_Get (
1206: p_encoded => FND_API.G_FALSE,
1201: THEN
1202: FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME,l_api_name);
1203: END IF;
1204: -- Standard call to get message count and if count=1, get the message
1205: FND_MSG_PUB.Count_And_Get (
1206: p_encoded => FND_API.G_FALSE,
1207: p_count => x_msg_count,
1208: p_data => x_msg_data
1209: );
1223: BEGIN
1224: -- Initialize message list if p_init_msg_list is set to TRUE.
1225: IF FND_API.to_Boolean( p_init_msg_list )
1226: THEN
1227: FND_MSG_PUB.initialize;
1228: END IF;
1229:
1230: -- Initialize API return status to SUCCESS
1231: x_return_status := FND_API.G_RET_STS_SUCCESS;
1235: -- THEN
1236: -- x_return_status := FND_API.G_RET_STS_ERROR;
1237:
1238: -- Debug Message
1239: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
1240: PVX_Utility_PVT.debug_message('Private API: Validate_dm_model_rec');
1241: END IF;
1242: -- Standard call to get message count and if count is 1, get message info.
1243: FND_MSG_PUB.Count_And_Get
1239: IF (FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_ERROR)) THEN
1240: PVX_Utility_PVT.debug_message('Private API: Validate_dm_model_rec');
1241: END IF;
1242: -- Standard call to get message count and if count is 1, get message info.
1243: FND_MSG_PUB.Count_And_Get
1244: (p_count => x_msg_count,
1245: p_data => x_msg_data
1246: );
1247: END Validate_Attr_Principal_Rec;