The following lines contain the word 'select', 'insert', 'update' or 'delete':
insert into msd_test values ('VM' || to_char(sysdate, 'hh24:mi') || ' ' || a);
x_delete_flag VARCHAR2(1);
select distinct
mla.instance,
ml.level_type_code,
mla.level_id,
mla.parent_level_id
from msd_st_level_associations mla, msd_levels ml
where mla.level_id = ml.level_id AND
mla.instance <> '0'
and ml.plan_type is null --vinekuma
/* Bug no 3799518. Enable load of level_org_asscns in legacy load as stand alone */
union
select distinct
mla.instance,
ml.level_type_code,
mla.level_id,
mla.parent_level_id
from msd_level_associations mla,
msd_levels ml
where mla.level_id = ml.level_id
and ml.plan_type is null --vinekuma
and exists (select 1
from msd_st_level_org_asscns mlo
where mla.instance = mlo.instance
and mla.level_id = mlo.level_id
and mlo.instance <> '0'
and rownum < 2);
select distinct
mla.instance,
mla.level_id,
ml.level_type_code
from msd_st_level_associations mla, msd_levels ml
where mla.level_id = ml.level_id AND
mla.instance <> '0' AND
ml.plan_type is null --vinekuma
order by instance, level_type_code, mla.level_id;
x_delete_flag := 'N';
x_delete_flag := 'Y';
/* DWK Fetch new seq number for deleted level values */
SELECT msd.msd_last_refresh_number_s.nextval
INTO l_seq_num from dual;
p_update_lvl_table => 0,
/* OPM Comment Rajesh Patangya */
p_delete_flag => x_delete_flag,
p_seq_num => l_seq_num
--,p_launched_from => v_launched_from --jarorad
) ;
Delete from msd_st_level_associations
where instance = Relationship_Rec.instance
and level_id = Relationship_Rec.level_id
and parent_level_id = Relationship_Rec.parent_level_id ;
p_update_lvl_table => 1,
/* OPM Comment Rajesh Patangya */
p_delete_flag => x_delete_flag,
p_seq_num => l_seq_num
--,p_launched_from => v_launched_from --jarorad
) ;
Delete from msd_st_level_values
where instance = Relationship_Rec.instance
and level_id = Relationship_Rec.level_id ;
Delete from msd_st_level_associations
where instance = Relationship_Rec.instance
and level_id = Relationship_Rec.level_id
and parent_level_id = Relationship_Rec.parent_level_id ;
/* DWK. Cleanup deleted level value table after pull */
msd_translate_level_values.clean_deleted_level_values( errbuf, retcode);
Delete from msd_st_level_values
where level_id in (
select level_id
from msd_levels
where level_type_code = '1'
and plan_type is null) ; --vinekuma