219: ELSE
220: FND_MSG_PUB.Add;
221: END IF;
222:
223: g_common_currency := NVL(FND_PROFILE.Value('PV_COMMON_CURRENCY'), 'USD');
224: Debug('The common currency is: ' || g_common_currency);
225:
226: g_period_set_name := FND_PROFILE.Value('AS_FORECAST_CALENDAR');
227: Debug('The Period Set Name is: ' || g_period_set_name);
222:
223: g_common_currency := NVL(FND_PROFILE.Value('PV_COMMON_CURRENCY'), 'USD');
224: Debug('The common currency is: ' || g_common_currency);
225:
226: g_period_set_name := FND_PROFILE.Value('AS_FORECAST_CALENDAR');
227: Debug('The Period Set Name is: ' || g_period_set_name);
228:
229: select nvl(max(attribute_trend_id),0) + 1 into l_next_trend_id from pv_entity_attr_trends;
230: Debug('Next available attribute_trend_id: ' || l_next_trend_id);
228:
229: select nvl(max(attribute_trend_id),0) + 1 into l_next_trend_id from pv_entity_attr_trends;
230: Debug('Next available attribute_trend_id: ' || l_next_trend_id);
231:
232: l_last_incr_refresh_str := FND_PROFILE.VALUE('PV_PT_TREND_LAST_UPDATE');
233:
234: IF (p_new_partners_flag = 'Y' and l_last_incr_refresh_str is not null ) OR p_partner_id is not null THEN
235:
236: if p_partner_id is null then
566: -- ------------------------------------------------------------------
567: -- update the profile value so the
568: -- next incremental refresh will be based on this timestamp.
569: --
570: -- FND_PROFILE.PUT changes the profile value in the session.
571: -- FND_PROFILE.SAVE saves the profile value to the database.
572: -- ------------------------------------------------------------------
573:
574: if p_partner_id is null then
567: -- update the profile value so the
568: -- next incremental refresh will be based on this timestamp.
569: --
570: -- FND_PROFILE.PUT changes the profile value in the session.
571: -- FND_PROFILE.SAVE saves the profile value to the database.
572: -- ------------------------------------------------------------------
573:
574: if p_partner_id is null then
575: FND_PROFILE.PUT('PV_PT_TREND_LAST_UPDATE', l_run_date_str);
571: -- FND_PROFILE.SAVE saves the profile value to the database.
572: -- ------------------------------------------------------------------
573:
574: if p_partner_id is null then
575: FND_PROFILE.PUT('PV_PT_TREND_LAST_UPDATE', l_run_date_str);
576: l_ret_val := FND_PROFILE.SAVE('PV_PT_TREND_LAST_UPDATE', l_run_date_str,'SITE');
577: Debug('The next incremental refresh will start from ' || l_run_date_str);
578: end if;
579:
572: -- ------------------------------------------------------------------
573:
574: if p_partner_id is null then
575: FND_PROFILE.PUT('PV_PT_TREND_LAST_UPDATE', l_run_date_str);
576: l_ret_val := FND_PROFILE.SAVE('PV_PT_TREND_LAST_UPDATE', l_run_date_str,'SITE');
577: Debug('The next incremental refresh will start from ' || l_run_date_str);
578: end if;
579:
580: if l_warning_count > 10 then