447:
448:
449: /* Get date range for which data needs to be collected for this entity */
450:
451: SELECT nvl(fnd_date.canonical_to_date(start_date),to_date('01/01/1950','MM/DD/RRRR')),
452: nvl(fnd_date.canonical_to_date(end_date), sysdate)
453: INTO min_hist_creation_date, max_hist_creation_date
454: FROM dual;
455: retcode := 0;
448:
449: /* Get date range for which data needs to be collected for this entity */
450:
451: SELECT nvl(fnd_date.canonical_to_date(start_date),to_date('01/01/1950','MM/DD/RRRR')),
452: nvl(fnd_date.canonical_to_date(end_date), sysdate)
453: INTO min_hist_creation_date, max_hist_creation_date
454: FROM dual;
455: retcode := 0;
456:
505:
506: if start_date is null and end_date is null then
507: null;
508: elsif start_date is not null and end_date is null then
509: min_hist_creation_date := fnd_date.canonical_to_date(start_date);
510: max_hist_creation_date := sysdate;
511: elsif end_date is not null and start_date is null then
512: min_hist_creation_date := sysdate;
513: max_hist_creation_date := round(fnd_date.canonical_to_date(end_date)+1);
509: min_hist_creation_date := fnd_date.canonical_to_date(start_date);
510: max_hist_creation_date := sysdate;
511: elsif end_date is not null and start_date is null then
512: min_hist_creation_date := sysdate;
513: max_hist_creation_date := round(fnd_date.canonical_to_date(end_date)+1);
514: elsif end_date is not null and start_date is not null then
515: min_hist_creation_date := fnd_date.canonical_to_date(start_date);
516: max_hist_creation_date := round(fnd_date.canonical_to_date(end_date)+1);
517: end if;
511: elsif end_date is not null and start_date is null then
512: min_hist_creation_date := sysdate;
513: max_hist_creation_date := round(fnd_date.canonical_to_date(end_date)+1);
514: elsif end_date is not null and start_date is not null then
515: min_hist_creation_date := fnd_date.canonical_to_date(start_date);
516: max_hist_creation_date := round(fnd_date.canonical_to_date(end_date)+1);
517: end if;
518:
519: if audit_duration is not null then
512: min_hist_creation_date := sysdate;
513: max_hist_creation_date := round(fnd_date.canonical_to_date(end_date)+1);
514: elsif end_date is not null and start_date is not null then
515: min_hist_creation_date := fnd_date.canonical_to_date(start_date);
516: max_hist_creation_date := round(fnd_date.canonical_to_date(end_date)+1);
517: end if;
518:
519: if audit_duration is not null then
520: min_hist_creation_date := sysdate - audit_duration;
1464: BEGIN
1465: IF p_datatype = 'N' THEN
1466: l_varchar_out := to_char(fnd_number.canonical_to_number(p_value));
1467: ELSIF p_datatype = 'X' THEN
1468: l_varchar_out := fnd_date.canonical_to_date(p_value);
1469: ELSIF p_datatype = 'Y' THEN
1470: l_varchar_out := fnd_date.canonical_to_date(p_value);
1471: ELSIF p_datatype = 'C' THEN
1472: l_varchar_out := p_value;
1466: l_varchar_out := to_char(fnd_number.canonical_to_number(p_value));
1467: ELSIF p_datatype = 'X' THEN
1468: l_varchar_out := fnd_date.canonical_to_date(p_value);
1469: ELSIF p_datatype = 'Y' THEN
1470: l_varchar_out := fnd_date.canonical_to_date(p_value);
1471: ELSIF p_datatype = 'C' THEN
1472: l_varchar_out := p_value;
1473: ELSE
1474: l_varchar_out := p_value;