The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT price_plan_id, aw_code
INTO l_price_plan_id, l_aw_name1
FROM QPR_PRICE_PLANS_B
WHERE PRICE_PLAN_ID =P_PRICE_PLAN_ID
and rownum < 2;
select 1 into l_rownum
from qpr_pn_lines
where price_plan_id = p_price_plan_id
and rownum < 2;
'Delete deals before deleting priceplan');
select 1 into l_rownum
from qpr_usr_price_plans
where aw_type_code = 'DATAMART'
and price_plan_id = p_price_plan_id
and default_assg_flag = 'Y'
and rownum < 2;
dbms_aw.aw_delete('APPS',l_aw_name1);
fnd_file.put_line(fnd_file.log,'deleted analytic workspace '||l_aw_name1||
' '||to_char(sysdate, 'hh24:mi:ss')||' '||l_stmtnum);
update qpr_price_plans_b
set aw_created_flag = 'N'
where price_plan_id = p_price_plan_id;
fnd_file.put_line(fnd_file.log,'updated qpr_price_plans table '||
to_char(sysdate, 'hh24:mi:ss')||' '||l_stmtnum);
if(p_delete_qpr_tables = 'N') then
l_stmtnum := 350;
if(p_delete_qpr_tables = 'Y') then
l_stmtnum := 100;
qpr_report_entities_pvt.delete_reports(
p_price_plan_id => p_price_plan_id,
x_return_status => l_output2);
fnd_file.put_line(fnd_file.log,'Deleted reports for analytic workspace '||
l_aw_name1||' '||to_char(sysdate, 'hh24:mi:ss')||' '||l_stmtnum);
qpr_dashboard_util.delete_dashboards(
p_price_plan_id => p_price_plan_id,
x_return_status => l_output3);
fnd_file.put_line(fnd_file.log,'deleted dashboards for analytic workspace'
||l_aw_name1||' '||to_char(sysdate, 'hh24:mi:ss')||' '||l_stmtnum);
delete from qpr_usr_price_plans where price_plan_id = p_price_plan_id;
fnd_file.put_line(fnd_file.log,'deleted assignment for analytic workspace'
||l_aw_name1||' '||to_char(sysdate, 'hh24:mi:ss')||' '||l_stmtnum);
raise l_unable_to_delete;
raise l_unable_to_delete;
delete from qpr_price_plans_b where price_plan_id = p_price_plan_id;
delete from qpr_price_plans_tl where price_plan_id = p_price_plan_id;
delete from qpr_dimensions where price_plan_id = p_price_plan_id;
delete from qpr_hierarchies where price_plan_id = p_price_plan_id;
delete from qpr_hier_levels where price_plan_id = p_price_plan_id;
delete from qpr_dim_attributes where price_plan_id = p_price_plan_id;
delete from qpr_lvl_attributes where price_plan_id = p_price_plan_id;
delete from qpr_cubes where price_plan_id = p_price_plan_id;
delete from qpr_cube_dims where price_plan_id = p_price_plan_id;
delete from qpr_measures where price_plan_id = p_price_plan_id;
delete from qpr_meas_aggrs where price_plan_id = p_price_plan_id;
delete from qpr_set_levels where price_plan_id = p_price_plan_id;
delete from qpr_scopes where parent_entity_type = 'DATAMART'
and parent_id = p_price_plan_id;
fnd_file.put_line(fnd_file.log,'deleted from qp tables for price_plan_id:'
||p_price_plan_id||' '||to_char(sysdate, 'hh24:mi:ss'));
elsif(p_delete_qpr_tables = 'N') then
fnd_file.put_line(fnd_file.log,
'Price plan tables not deleted as value of qp delete tables = "N" '||
' '||to_char(sysdate, 'hh24:mi:ss'));
raise l_unable_to_delete;
when l_unable_to_delete then
retcode := 2;
END DELETE_AW;