383: return;
384: end if;
385:
386: if(Approver.person_id is null) then
387: select user_name into l_user from fnd_user
388: where user_id=Approver.user_id;
389: else
390: /* select user_name into l_user from fnd_user a,per_all_people b
391: where b.person_id=Approver.person_id and
386: if(Approver.person_id is null) then
387: select user_name into l_user from fnd_user
388: where user_id=Approver.user_id;
389: else
390: /* select user_name into l_user from fnd_user a,per_all_people b
391: where b.person_id=Approver.person_id and
392: a.employee_id is not null and
393: a.employee_id = b.person_id; */
394:
392: a.employee_id is not null and
393: a.employee_id = b.person_id; */
394:
395: -- Rewritten the above query as part of performance bug# 5221298
396: /*select user_name into l_user from fnd_user a
397: where a.employee_id = Approver.person_id
398: and a.employee_id is not null
399: and exists (select 1 from per_all_people where person_id = Approver.person_id);*/
400:
398: and a.employee_id is not null
399: and exists (select 1 from per_all_people where person_id = Approver.person_id);*/
400:
401: -- RLNAGARA B5714223 Replaced the above query with the below query.
402: select user_name into l_user from fnd_user
403: where user_id=ame_util.personidtouserid (approver.person_id);
404:
405: end if;
406:
546: /* No Approval Required */
547: P_resultout:='COMPLETE:N';
548: else
549: if(Approver.person_id is null) then
550: select user_name into l_user from fnd_user
551: where user_id=Approver.user_id;
552: else
553: /* select user_name into l_user from fnd_user a,per_all_people b
554: where
549: if(Approver.person_id is null) then
550: select user_name into l_user from fnd_user
551: where user_id=Approver.user_id;
552: else
553: /* select user_name into l_user from fnd_user a,per_all_people b
554: where
555: b.person_id=Approver.person_id and
556: a.employee_id is not null and
557: a.employee_id = b.person_id; */
556: a.employee_id is not null and
557: a.employee_id = b.person_id; */
558:
559: -- Rewritten the above query as part of performance bug# 5221298
560: /*select user_name into l_user from fnd_user a
561: where a.employee_id = Approver.person_id
562: and a.employee_id is not null
563: and exists (select 1 from per_all_people where person_id = Approver.person_id);*/
564:
563: and exists (select 1 from per_all_people where person_id = Approver.person_id);*/
564:
565: --Rewritten the above query as part of fix Bug No.7656325
566:
567: select user_name into l_user from fnd_user
568: where user_id=ame_util.PERSONIDTOUSERID(Approver.person_id);
569:
570: end if;
571: