The following lines contain the word 'select', 'insert', 'update' or 'delete':
x_delete_flag VARCHAR2(1) := 'Y' ;
select instance,
min(shipped_date) min_ship_date,
max(shipped_date) max_ship_date
from msd_st_shipment_data
where instance <> '0'
group by instance ;
SELECT msd.msd_last_refresh_number_s.nextval into l_new_refresh_Num from dual;
p_delete_flag => x_delete_flag);
/* Delete fact rows that are not used by any demand plans */
MSD_TRANSLATE_FACT_DATA.clean_fact_data( errbuf,
retcode,
x_dest_table);
x_delete_flag VARCHAR2(1) := 'Y' ;
select instance,
min(booked_date) min_ship_date,
max(booked_date) max_ship_date
from msd_st_booking_data
where instance <> '0'
group by instance ;
SELECT msd.msd_last_refresh_number_s.nextval into l_new_refresh_Num from dual;
p_delete_flag => x_delete_flag);
/* Delete fact rows that are not used by any demand plans */
MSD_TRANSLATE_FACT_DATA.clean_fact_data( errbuf,
retcode,
x_dest_table);
select instance
from msd_st_uom_conversions
where instance <> '0'
group by instance;
SELECT msd.msd_last_refresh_number_s.nextval into l_new_refresh_Num from dual;
/* Delete fact rows that are not used by any demand plans */
/* Not needed. Records are physically deleted
MSD_TRANSLATE_FACT_DATA.clean_fact_data( errbuf,
retcode,
x_dest_table);
select
min(conversion_date) min_ship_date,
max(conversion_date) max_ship_date
from msd_st_currency_conversions
where nvl(instance, '-888') <> '0';
select instance,
min(ship_date) min_ship_date,
max(ship_date) max_ship_date
from msd_st_sales_opportunity_data
group by instance ;
select instance,
min(period_start_date) min_ship_date,
max(period_end_date) max_ship_date
from msd_st_sales_forecast
group by instance ;
Delete from msd_st_sales_forecast
where instance = Sales_Fcst_Rec.instance
and ( ( to_date(period_start_date,'DD-MON-RRRR')
between to_date(Sales_Fcst_Rec.min_ship_date,'DD-MON-RRRR')
and to_date(Sales_Fcst_Rec.max_ship_date,'DD-MON-RRRR')
)
OR ( to_date(period_end_date,'DD-MON-RRRR')
between to_date(Sales_Fcst_Rec.min_ship_date,'DD-MON-RRRR')
and to_date(Sales_Fcst_Rec.max_ship_date,'DD-MON-RRRR')
)
);
x_delete_flag VARCHAR2(1) := 'Y' ;
select instance,
forecast_designator
from msd_st_mfg_forecast
where instance <> '0'
group by instance, forecast_designator
order by instance;
SELECT msd.msd_last_refresh_number_s.nextval into l_new_refresh_Num from dual;
p_delete_flag => x_delete_flag );
/* Delete fact rows that are not used by any demand plans */
MSD_TRANSLATE_FACT_DATA.clean_fact_data( errbuf,
retcode,
x_dest_table);
/* DWK Delete existing calendar after post process */
DELETE msd_st_time WHERE instance = '-999';
select distinct instance, price_list_name
from msd_st_price_list
where nvl(instance, '888') <> '0' and price_list_name is not null;
SELECT msd.msd_last_refresh_number_s.nextval into l_new_refresh_Num from dual;
/* Delete fact rows that are not used by any demand plans */
MSD_TRANSLATE_FACT_DATA.clean_fact_data( errbuf,
retcode,
x_dest_table);
/* DWK. Do not delete any rows with instance = '0'
Attention. Currency staging won't have any instance id */
x_sql_statement := 'DELETE FROM ' || p_table_name ||
' where nvl(instance,''-999'') <> ''0'' ' ||
' and nvl(instance,''-999'') = ' ||
' nvl(:p_instance_id, nvl(instance,''-999'')) ';
x_sql_statement := ' DELETE FROM ' || p_table_name ||
' where instance = nvl(:p_instance_id, instance) '||
' and price_list_name = nvl(:p_price_list, price_list_name)';