DBA Data[Home] [Help]

APPS.AMW_WF_HIERARCHY_PKG SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 90

select	name
from 	amw_process;
Line: 97

insert_row_cnt NUMBER;
Line: 119

select fnd_profile.value('AMW_SET_STD_PROCESS') into l_std_process_flag from dual;
Line: 142

insert_row_cnt := 0;
Line: 157

        select 1
        into l_dummy
        from amw_process
        where name = v_child_name(i);
Line: 169

       	insert_row_cnt := insert_row_cnt + 1;
Line: 170

        v_forall_list(insert_row_cnt) := v_child_name(i);
Line: 187

        select 1
        into l_dummy
        from amw_process
        where name = v_parent_name(j);
Line: 199

       	insert_row_cnt := insert_row_cnt + 1;
Line: 200

        v_forall_list(insert_row_cnt) := v_parent_name(j);
Line: 229

insert_row_cnt := 0;
Line: 232

	insert_row_cnt := insert_row_cnt + 1;
Line: 233

	v_forall_list(insert_row_cnt) := v_final_list(v_index);
Line: 249

      INSERT INTO amw_process(   PROCESS_REV_ID,
				 PROCESS_ID,
				 SIGNIFICANT_PROCESS_FLAG,
				 STANDARD_PROCESS_FLAG,
				 APPROVAL_STATUS,
				 CERTIFICATION_STATUS,
				 PROCESS_OWNER_ID,
				 PROCESS_CATEGORY,
				 APPLICATION_OWNER_ID,
				 FINANCE_OWNER_ID,
				 LAST_UPDATE_DATE,
				 LAST_UPDATED_BY,
				 CREATION_DATE,
				 CREATED_BY,
				 LAST_UPDATE_LOGIN,
				 OBJECT_VERSION_NUMBER,
				 ITEM_TYPE,
				 NAME )
				VALUES
				(AMW_PROCESS_S.nextval,
         			AMW_PROCESS_S.nextval,
				p_SIGNIFICANT_PROCESS_FLAG,
				l_std_process_flag,
				p_APPROVAL_STATUS,
				p_CERTIFICATION_STATUS,
				decode(p_PROCESS_OWNER_ID, -1, to_number(null), p_PROCESS_OWNER_ID),
				p_PROCESS_CATEGORY,
				decode(p_APPLICATION_OWNER_ID, -1, to_number(null), p_APPLICATION_OWNER_ID),
				decode(p_FINANCE_OWNER_ID, -1, to_number(null), p_FINANCE_OWNER_ID),
				sysdate,
				G_USER_ID,
				sysdate,
				G_USER_ID,
				G_LOGIN_ID,
				1,
				'AUDITMGR',
				v_forall_final_list(v_ind));
Line: 288

v_parent_name.delete;
Line: 290

v_child_name.delete;
Line: 333

    select CHILD_PROCESS_NAME
	from amw_wf_hierarchy_v
    where PARENT_PROCESS_NAME=l_name;
Line: 356

    select PARENT_PROCESS_NAME
	from amw_wf_hierarchy_v
    where CHILD_PROCESS_NAME=l_name;
Line: 400

** type t_delete_list    IS   table of  amw_process.name%type INDEX BY BINARY_INTEGER;
Line: 401

** v_delete_list		       t_delete_list;
Line: 408

** delete_row_cnt NUMBER;
Line: 412

** select	name
** from 	amw_process;
Line: 428

** select name
** into root_process_name
** from amw_process
** where process_id = -1;
Line: 439

** delete_row_cnt := 0;
Line: 445

** 		delete_row_cnt := delete_row_cnt + 1;
Line: 446

** 		v_delete_list(delete_row_cnt) := v_amwp_name(v_index);
Line: 452

** v_index := v_delete_list.first;
Line: 453

** fnd_file.put_line(fnd_file.log, 'PRINTING DELETE LIST');
Line: 454

** while v_index <= v_delete_list.last
** loop
** 	fnd_file.put_line(fnd_file.log, 'index: '||v_index||' value: '||v_delete_list(v_index));
Line: 457

** 	v_index := v_delete_list.next(v_index);
Line: 461

** FORALL v_ind IN 1..delete_row_cnt
** 	DELETE from amw_process
** 	where name = v_delete_list(v_ind);
Line: 466

** v_child_name.delete;
Line: 468

** v_child_list.delete;
Line: 469

** v_delete_list.delete;
Line: 495

  v_transition_parent_list.delete;
Line: 507

    select to_process_activity
	from wf_activity_transitions
    where from_process_activity = l_instance_id;
Line: 536

    select PARENT_PROCESS_ID
	from Amw_Process_Org_Relations
    where CHILD_PROCESS_ID=l_process_id
    and organization_id = l_org_id;
Line: 561

    select CHILD_PROCESS_ID
	from Amw_Process_Org_Relations
    where PARENT_PROCESS_ID=l_process_id
    and organization_id = l_org_id;
Line: 599

 select process_id, risk_count, control_count, 0, 0 from amw_process;
Line: 604

 insert_row_cnt  number;
Line: 610

	update amw_process ap
	set risk_count =
	(select count(ara.risk_id)
	from amw_risk_associations ara
	where pk1 = ap.process_id
	and object_type = 'PROCESS'),
	control_count =
	(select count(distinct aca.control_id)
	from amw_control_associations aca, amw_risk_associations ara
	where ara.pk1 = ap.process_id
	and ara.object_type = 'PROCESS'
	and aca.pk1 = ara.risk_id
	and aca.object_type = 'RISK');
Line: 638

	select nvl(sum(risk_count), 0), nvl(sum(control_count), 0)
	into l_risk_count, l_control_count
	from amw_process amwp, Amw_Proc_Hierarchy_Denorm apdenorm
	where apdenorm.process_id = v_index
	and apdenorm.up_down_ind = 'D'
	and amwp.process_id = apdenorm.parent_child_id;
Line: 655

	update amw_process
	set risk_count = v_amw_counts(v_index).risk_count,
	control_count = v_amw_counts(v_index).control_count
	where process_id = v_index;
Line: 690

select process_id, risk_count, control_count, 0, 0
from amw_process_organization
where organization_id = l_org_id
and end_date is null;
Line: 696

select distinct organization_id from amw_process_organization where organization_id = nvl(p_org_id, organization_id) and end_date is null;
Line: 702

insert_row_cnt  number;
Line: 705

	update amw_process_organization apo
	set risk_count =
	(select count(ara.risk_id)
	from amw_risk_associations ara
	where pk1 = apo.process_organization_id
	and object_type = 'PROCESS_ORG'),
	control_count =
	(select count(distinct aca.control_id)
	from amw_control_associations aca, amw_risk_associations ara
	where ara.pk1 = apo.process_organization_id
	and ara.object_type = 'PROCESS_ORG'
	and aca.pk1 = ara.risk_association_id
	and aca.object_type = 'RISK_ORG')
	where organization_id = nvl(p_org_id, organization_id)
	and   end_date is null;
Line: 738

	select nvl(sum(risk_count), 0), nvl(sum(control_count), 0)
	into l_risk_count, l_control_count
	from amw_process_organization amwp, Amw_Org_Hierarchy_Denorm aodenorm
	where  aodenorm.organization_id = l_org
	and aodenorm.process_id = v_index
	and aodenorm.up_down_ind = 'D'
	and amwp.process_id = aodenorm.parent_child_id
	and amwp.organization_id = l_org
	and amwp.end_date is null;
Line: 759

	update amw_process_organization
	set risk_count = v_amw_porg_counts(v_index).risk_count,
	control_count = v_amw_porg_counts(v_index).control_count
	where process_id = v_index
	and organization_id = l_org
	and end_date is null;
Line: 769

    v_amw_porg_counts.delete;
Line: 798

	select process_id from amw_process_organization where organization_id = l_org_id and end_date is null;
Line: 813

delete from Amw_Org_Hierarchy_Denorm where organization_id = p_org_id;
Line: 844

			select 1 into l_dummy
			from Amw_Org_Hierarchy_Denorm
			where Organization_Id = p_org_id
			and Process_Id = v_apo_id(v_index)
			and Parent_Child_Id = v_org_parent_id(i)
			and Up_Down_Ind = 'U';
Line: 853

				insert into Amw_Org_Hierarchy_Denorm
				(Organization_Id,
				Process_Id,
				Parent_Child_Id,
				Up_Down_Ind,
				Last_Update_Date,
				Last_Updated_By,
				Creation_Date,
				Created_By,
				Last_Update_Login,
				OBJECT_VERSION_NUMBER
				)
				values
				(p_org_id,
				v_apo_id(v_index),
				v_org_parent_id(i),
				'U',
				sysdate,
				G_USER_ID,
				sysdate,
				G_USER_ID,
				G_LOGIN_ID,
				1);
Line: 889

			select 1 into l_dummy
			from Amw_Org_Hierarchy_Denorm
			where Organization_Id = p_org_id
			and Process_Id = v_apo_id(v_index)
			and Parent_Child_Id = v_org_child_id(i)
			and Up_Down_Ind = 'D';
Line: 898

				insert into Amw_Org_Hierarchy_Denorm
				(Organization_Id,
				Process_Id,
				Parent_Child_Id,
				Up_Down_Ind,
				Last_Update_Date,
				Last_Updated_By,
				Creation_Date,
				Created_By,
				Last_Update_Login,
				OBJECT_VERSION_NUMBER
				)
				values
				(p_org_id,
				v_apo_id(v_index),
				v_org_child_id(i),
				'D',
				sysdate,
				G_USER_ID,
				sysdate,
				G_USER_ID,
				G_LOGIN_ID,
				1);
Line: 950

    select child_nondisp_name
	from amw_process_hierarchy_v
    where parent_nondisp_name=l_name;
Line: 965

	  select process_id into parent_id from amw_process where name = p_process_name;
Line: 966

	  select process_id into child_id from amw_process where name = c1_rec.child_nondisp_name;
Line: 968

          select  wpa.instance_id
          into instance_id
	  from wf_process_activities wpa,
	  wf_activities wa
	  where wpa.process_item_type = 'AUDITMGR'
	  and wpa.process_name = p_process_name
	  and wpa.process_name =  wa.name
	  and wa.end_date is null
	  and wa.item_type = 'AUDITMGR'
	  and wpa.process_version = wa.version
	  and wpa.activity_name = c1_rec.child_nondisp_name;
Line: 984

		select 1
		into l_dummy
		from Amw_Process_Org_Relations
		where ORGANIZATION_ID = p_org_id
		and PARENT_PROCESS_ID = parent_id
		and CHILD_PROCESS_ID = child_id;
Line: 994

			  insert into Amw_Process_Org_Relations
				 (ORGANIZATION_ID,
				 PARENT_PROCESS_ID,
				 CHILD_PROCESS_ID,
				 INSTANCE_ID,
				 EXCEPTION_PRESENT_FLAG,
				 LAST_UPDATE_DATE,
				 LAST_UPDATED_BY,
				 CREATION_DATE,
				 CREATED_BY,
				 LAST_UPDATE_LOGIN,
				 OBJECT_VERSION_NUMBER)
				 values
				 (p_org_id,
				 parent_id,
				 child_id,
				 instance_id,
				 'N',
				 sysdate,
				 G_USER_ID,
				 sysdate,
				 G_USER_ID,
				 G_LOGIN_ID,
				 1);
Line: 1150

		select 1
		into l_dummy
		from Amw_Process_Org_Relations
		where ORGANIZATION_ID = p_org_id
		and PARENT_PROCESS_ID = -1
		and CHILD_PROCESS_ID = p_process_id;
Line: 1161

			  insert into Amw_Process_Org_Relations
				 (ORGANIZATION_ID,
				 PARENT_PROCESS_ID,
				 CHILD_PROCESS_ID,
				 INSTANCE_ID,
				 EXCEPTION_PRESENT_FLAG,
				 LAST_UPDATE_DATE,
				 LAST_UPDATED_BY,
				 CREATION_DATE,
				 CREATED_BY,
				 LAST_UPDATE_LOGIN,
				 OBJECT_VERSION_NUMBER)
				 values
				 (p_org_id,
				 -1,
				 p_process_id,
				 0,
				 'N',
				 sysdate,
				 G_USER_ID,
				 sysdate,
				 G_USER_ID,
				 G_LOGIN_ID,
				 1);
Line: 1187

	 select name
	 into p_name
	 from amw_process
	 where process_id = p_process_id;
Line: 1286

		select 1
		into l_dummy
		from Amw_Process_Org_Relations
		where ORGANIZATION_ID = p_org_id
		and PARENT_PROCESS_ID = -1
		and CHILD_PROCESS_ID = p_process_id;
Line: 1297

			  insert into Amw_Process_Org_Relations
				 (ORGANIZATION_ID,
				 PARENT_PROCESS_ID,
				 CHILD_PROCESS_ID,
				 INSTANCE_ID,
				 EXCEPTION_PRESENT_FLAG,
				 LAST_UPDATE_DATE,
				 LAST_UPDATED_BY,
				 CREATION_DATE,
				 CREATED_BY,
				 LAST_UPDATE_LOGIN,
				 OBJECT_VERSION_NUMBER)
				 values
				 (p_org_id,
				 -1,
				 p_process_id,
				 0,
				 'N',
				 sysdate,
				 G_USER_ID,
				 sysdate,
				 G_USER_ID,
				 G_LOGIN_ID,
				 1);
Line: 1323

	 select name
	 into p_name
	 from amw_process
	 where process_id = p_process_id;
Line: 1366

procedure delete_org_relation(
		p_parent_process_id	in number,
		p_child_process_id	in number,
		p_org_id		in number) is

l_exist number := 0;
Line: 1379

select CHILD_PROCESS_ID
from Amw_Process_Org_Relations
where PARENT_PROCESS_ID = l_pid
and organization_id = p_oid;
Line: 1386

	delete from Amw_Process_Org_Relations
	where ORGANIZATION_ID = p_org_id
	and PARENT_PROCESS_ID = p_parent_process_id
	and CHILD_PROCESS_ID = p_child_process_id;
Line: 1391

		select count(ORGANIZATION_ID)
		into l_exist
		from Amw_Process_Org_Relations
		where ORGANIZATION_ID = p_org_id
		and CHILD_PROCESS_ID = p_child_process_id;
Line: 1423

                   delete_org_relation(
            		    p_parent_process_id	=> p_child_process_id,
            	    	p_child_process_id	=> c1_rec.CHILD_PROCESS_ID,
                		p_org_id		    => p_org_id);
Line: 1435

end delete_org_relation;
Line: 1472

	delete from Amw_Process_Org_Relations
	where ORGANIZATION_ID = p_org_id
	and CHILD_PROCESS_ID = p_process_id;
Line: 1490

	delete from amw_process_organization
	where organization_id = p_org_id
	and end_date is not null;
Line: 1535

    select CHILD_PROCESS_ID
	from Amw_Process_Org_Relations
    where PARENT_PROCESS_ID=l_id
    and organization_id = l_oid;
Line: 1553

			delete from Amw_Process_Org_Relations
			where ORGANIZATION_ID = p_org_id
			and PARENT_PROCESS_ID = p_process_id
			and CHILD_PROCESS_ID = c1_rec.CHILD_PROCESS_ID;
Line: 1638

	select employee_id
	into l_person_id
	from AMW_EMPLOYEES_CURRENT_V
	where party_id = p_process_owner_party_id;
Line: 1643

	select watl.display_name
	into  l_parent_disp_name
	from wf_activities_tl watl, wf_activities wa, amw_process ap
	where ap.process_id = p_parent_process_id
	and ap.name = wa.name
	and wa.item_type = 'AUDITMGR'
	and wa.end_date is null
	and watl.item_type = 'AUDITMGR'
	and watl.name = wa.name
	and watl.version = wa.version
	and watl.language = userenv('LANG');
Line: 1655

	select watl.display_name
	into  l_child_disp_name
	from wf_activities_tl watl, wf_activities wa, amw_process ap
	where ap.process_id = p_child_process_id
	and ap.name = wa.name
	and wa.item_type = 'AUDITMGR'
	and wa.end_date is null
	and watl.item_type = 'AUDITMGR'
	and watl.name = wa.name
	and watl.version = wa.version
	and watl.language = userenv('LANG');
Line: 1667

	select name
	into l_org_name
	from amw_audit_units_v
	where organization_id = p_org_id;
Line: 1683

	select 1
	into l_dummy
	from Amw_Process_Org_Relations
	where ORGANIZATION_ID = p_org_id
	and PARENT_PROCESS_ID = p_parent_process_id
	and CHILD_PROCESS_ID = p_child_process_id;
Line: 1693

		  insert into Amw_Process_Org_Relations
			 (ORGANIZATION_ID,
			 PARENT_PROCESS_ID,
			 CHILD_PROCESS_ID,
			 INSTANCE_ID,
			 EXCEPTION_PRESENT_FLAG,
			 LAST_UPDATE_DATE,
			 LAST_UPDATED_BY,
			 CREATION_DATE,
			 CREATED_BY,
			 LAST_UPDATE_LOGIN,
			 OBJECT_VERSION_NUMBER)
			 values
			 (p_org_id,
			 p_parent_process_id,
			 p_child_process_id,
			 0,
			 p_exception_yes,
			 sysdate,
			 G_USER_ID,
			 sysdate,
			 G_USER_ID,
			 G_LOGIN_ID,
			 1);
Line: 1719

	 select name
	 into p_name
	 from amw_process
	 where process_id = p_child_process_id;
Line: 1744

	delete_org_relation(p_parent_process_id, p_child_process_id, p_org_id);
Line: 1804

update amw_process amwp
set amwp.org_count =   (select count(process_organization_id)
                        from amw_process_organization amwpo
                        where amwpo.process_id = amwp.process_id
                        and amwpo.end_date is null);
Line: 2008

 select distinct organization_id
 from amw_process_organization
 where process_id = l_pid
 and end_date is null;
Line: 2014

 select distinct organization_id
 from amw_process_organization
 where process_id = l_pid
 and end_date is null
 and organization_id not in
(select distinct old_pk1 from amw_exceptions_b where ((old_pk2 = l_pid and object_type in ('PROCESS','RISK','CONTROL'))or (object_type = 'PROCESS' and old_pk3 = l_pid)) and old_pk1 is not null)
 and organization_id not in
(select distinct new_pk1 from amw_exceptions_b where ((new_pk2 = l_pid and object_type in ('PROCESS','RISK','CONTROL'))or (object_type = 'PROCESS' and new_pk3 = l_pid)) and new_pk1 is not null);
Line: 2165

select LTRIM(l_org_string, '1234567890') into str from dual;
Line: 2168

select SUBSTR(l_org_string, 1, diff) into orgstr from dual;
Line: 2182

select LTRIM(str, 'x') into l_org_string from dual;
Line: 2242

	select parent_process_id
	from Amw_Process_Org_Relations
	where organization_id = p_org_id
	and child_process_id = p_process_id;
Line: 2286

	insert into Amw_Process_Org_Relations
		 (ORGANIZATION_ID,
		 PARENT_PROCESS_ID,
		 CHILD_PROCESS_ID,
		 INSTANCE_ID,
		 EXCEPTION_PRESENT_FLAG,
		 LAST_UPDATE_DATE,
		 LAST_UPDATED_BY,
		 CREATION_DATE,
		 CREATED_BY,
		 LAST_UPDATE_LOGIN,
		 OBJECT_VERSION_NUMBER)
		 values
		 (p_org_id,
		 v_parent_pid(v_index),
		 p_process_id,
		 0,
		 'N',
		 sysdate,
		 G_USER_ID,
		 sysdate,
		 G_USER_ID,
		 G_LOGIN_ID,
		 1);
Line: 2315

 select name
 into l_name
 from amw_process
 where process_id = p_process_id;
Line: 2360

	select name into l_pname from amw_process where process_id = p_process_id;
Line: 2365

			select 1 into l_dummy
			from amw_process_organization
			where end_date is null
			and process_id = (select process_id from amw_process where name = v_child_name(i));
Line: 2397

	select 1 into l_dummy
	from amw_process_organization
	where process_id = p_process_id
	and end_date is null;
Line: 2566

	select nvl(employee_id, 0) into l_empid from fnd_user where user_id = p_user_id;
Line: 2571

	select party_id into l_party_id from amw_employees_current_v where employee_id = l_empid;
Line: 2578

		select 1 into l_dummy
		from amw_process_organization
		where end_date is null
		and organization_id = p_org_id
		and process_owner_id = l_party_id;
Line: 2605

	select nvl(employee_id, 0) into l_empid from fnd_user where user_id = p_user_id;
Line: 2610

		select org_information2
		into l_dummy
		from hr_organization_information
		where organization_id in (select distinct organization_id from amw_audit_units_v)
		and org_information_context = 'Organization Name Alias'
		and org_information2 = l_empid;
Line: 2625

		select 1
		into l_dummy
		from hr_organization_information
		where organization_id = p_org_id
		and org_information_context = 'Organization Name Alias'
		and org_information2 = l_empid;
Line: 2650

		select hoi.organization_id
		from hr_organization_information hoi, amw_audit_units_v aauv
		where hoi.organization_id = aauv.organization_id
		and hoi.org_information_context = 'Organization Name Alias'
		and hoi.org_information2 = l_emp;
Line: 2668

                    select 1 into l_dummy
                    from dual where p_org_id in
                    (select organization_id_child
                     from
                        (select organization_id_parent, organization_id_child from per_org_structure_elements
                        where org_structure_version_id =
                            (select org_structure_version_id from per_org_structure_versions
                            where date_to is null and organization_structure_id =
                            (select organization_structure_id from per_organization_structures where name = hier_name)))
                    start with organization_id_parent = l_org
                    connect by organization_id_parent = prior organization_id_child);
Line: 2700

        select b2.process_id
        from amw_wf_hierarchy_v a, amw_process b1, amw_process b2
        where b1.name = a.parent_process_name
        and b1.item_type = a.parent_item_type
        and b2.name = a.child_process_name
        and b2.item_type = a.child_item_type
        and b1.process_id = l_id;
Line: 2727

        select b1.process_id
        from amw_wf_hierarchy_v a, amw_process b1, amw_process b2
        where b1.name = a.parent_process_name
        and b1.item_type = a.parent_item_type
        and b2.name = a.child_process_name
        and b2.item_type = a.child_item_type
        and b2.process_id = l_id;
Line: 2753

	select process_id from amw_process;
Line: 2774

delete from Amw_Proc_Hierarchy_Denorm;
Line: 2792

				select 1 into l_dummy
				from Amw_Proc_Hierarchy_Denorm
				where Process_Id = l_process_id
				and Parent_Child_Id = l_parent_id
				and Up_Down_Ind = 'U';
Line: 2799

					insert into Amw_Proc_Hierarchy_Denorm
					(Process_Id,
					Parent_Child_Id,
					Up_Down_Ind,
					Last_Update_Date,
					Last_Updated_By,
					Creation_Date,
					Created_By,
					Last_Update_Login,
					OBJECT_VERSION_NUMBER
					)
					values
					(l_process_id,
					l_parent_id,
					'U',
					sysdate,
					G_USER_ID,
					sysdate,
					G_USER_ID,
					G_LOGIN_ID,
					1);
Line: 2830

				select 1 into l_dummy
				from Amw_Proc_Hierarchy_Denorm
				where Process_Id = l_process_id
				and Parent_Child_Id = l_child_id
				and Up_Down_Ind = 'D';
Line: 2837

					insert into Amw_Proc_Hierarchy_Denorm
					(Process_Id,
					Parent_Child_Id,
					Up_Down_Ind,
					Last_Update_Date,
					Last_Updated_By,
					Creation_Date,
					Created_By,
					Last_Update_Login,
					OBJECT_VERSION_NUMBER
					)
					values
					(l_process_id,
					l_child_id,
					'D',
					sysdate,
					G_USER_ID,
					sysdate,
					G_USER_ID,
					G_LOGIN_ID,
					1);
Line: 2906

type t_delete_list    IS   table of amw_process.name%type index by binary_integer;
Line: 2907

v_delete_list		   t_delete_list;
Line: 2909

type t_delete_pid_list    IS   table of amw_process.process_id%type index by binary_integer;
Line: 2910

v_delete_pid_list	       t_delete_pid_list;
Line: 2922

delete_row_cnt NUMBER;
Line: 2928

select	name, process_id
from 	amw_process;
Line: 2932

select organization_id
from amw_process_organization
where process_id = p_pid;
Line: 2937

select exception_id
from amw_exceptions_b
where object_type = 'PROCESS_VARIANT_ADD'
and new_pk1 not in
(select process_id from amw_process where standard_process_flag = 'Y');
Line: 2981

select name
into root_process_name
from amw_process
where process_id = -1;
Line: 3013

delete_row_cnt := 0;
Line: 3049

		delete_row_cnt := delete_row_cnt + 1;
Line: 3050

		v_delete_list(delete_row_cnt) := v_amwp_name(v_index);
Line: 3063

 v_index := v_delete_list.first;
Line: 3064

 while v_index <= v_delete_list.last
 loop
    -- opportunity for performance improvement exist
        select process_id
        into  v_delete_pid_list(v_index)
        from amw_process
        where item_type = 'AUDITMGR'
        and name = v_delete_list(v_index);
Line: 3073

	v_index := v_delete_list.next(v_index);
Line: 3100

 v_index := v_delete_pid_list.first;
Line: 3101

 while v_index <= v_delete_pid_list.last
 loop
	open c_org( v_delete_pid_list(v_index) );
Line: 3113

			disassociate_process_org(p_process_id	=> v_delete_pid_list(v_index),
						p_org_id	=> v_org(v_index1),
						x_return_status	=> x_return_status1,
						x_msg_count	=> x_msg_count1,
						x_msg_data	=> x_msg_data1);
Line: 3126

	v_index := v_delete_pid_list.next(v_index);
Line: 3130

 FORALL v_ind IN 1..delete_row_cnt
	DELETE from amw_risk_associations
	where pk1 = v_delete_pid_list(v_ind)
	and object_type = 'PROCESS';
Line: 3135

 FORALL v_ind IN 1..delete_row_cnt
	DELETE from amw_objective_associations
	where pk1 = v_delete_pid_list(v_ind)
	and object_type = 'PROCESS';
Line: 3141

FORALL v_ind IN 1..delete_row_cnt
	DELETE from amw_process
	where name = v_delete_list(v_ind);
Line: 3146

FORALL v_ind IN 1..delete_row_cnt
	update wf_activities
	set end_date = sysdate
	where name = v_delete_list(v_ind)
	and item_type = 'AUDITMGR'
	and end_date is null;
Line: 3159

v_child_name.delete;
Line: 3162

v_delete_list.delete;
Line: 3163

v_delete_pid_list.delete;
Line: 3169

update amw_process ap1
set ap1.standard_variation =
(select ap2.process_id from amw_process ap2 where ap2.process_id = ap1.standard_variation);
Line: 3178

    delete from amw_exceptions_b where exception_id = l_ex_id;
Line: 3179

    delete from amw_exceptions_reasons where exception_id = l_ex_id;
Line: 3180

    delete from amw_exceptions_tl where exception_id = l_ex_id;
Line: 3185

delete from amw_process a where not exists
(select name from wf_activities w where w.name = a.name and w.item_type = 'AUDITMGR' and w.end_date is null);
Line: 3253

type t_delete_list    IS   table of amw_process.name%type index by binary_integer;
Line: 3254

v_delete_list		   t_delete_list;
Line: 3256

type t_delete_pid_list    IS   table of amw_process.process_id%type index by binary_integer;
Line: 3257

v_delete_pid_list	       t_delete_pid_list;
Line: 3263

delete_row_cnt NUMBER;
Line: 3269

select	name, process_id
from 	amw_process;
Line: 3273

select organization_id
from amw_process_organization
where process_id = p_pid;
Line: 3278

select exception_id
from amw_exceptions_b
where object_type = 'PROCESS_VARIANT_ADD'
and new_pk1 not in
(select process_id from amw_process where standard_process_flag = 'Y');
Line: 3311

select name
into root_process_name
from amw_process
where process_id = -1;
Line: 3318

delete_row_cnt := 0;
Line: 3334

		delete_row_cnt := delete_row_cnt + 1;
Line: 3335

		v_delete_list(delete_row_cnt) := v_amwp_name(v_index);
Line: 3340

 v_index := v_delete_list.first;
Line: 3341

 while v_index <= v_delete_list.last
 loop
        select process_id
        into  v_delete_pid_list(v_index)
        from amw_process
        where item_type = 'AUDITMGR'
        and name = v_delete_list(v_index);
Line: 3348

	v_index := v_delete_list.next(v_index);
Line: 3353

 v_index := v_delete_pid_list.first;
Line: 3354

 while v_index <= v_delete_pid_list.last
 loop
	open c_org( v_delete_pid_list(v_index) );
Line: 3366

			disassociate_process_org(p_process_id	=> v_delete_pid_list(v_index),
						p_org_id	=> v_org(v_index1),
						x_return_status	=> x_return_status1,
						x_msg_count	=> x_msg_count1,
						x_msg_data	=> x_msg_data1);
Line: 3379

	v_index := v_delete_pid_list.next(v_index);
Line: 3383

 FORALL v_ind IN 1..delete_row_cnt
	DELETE from amw_risk_associations
	where pk1 = v_delete_pid_list(v_ind)
	and object_type = 'PROCESS';
Line: 3388

 FORALL v_ind IN 1..delete_row_cnt
	DELETE from amw_objective_associations
	where pk1 = v_delete_pid_list(v_ind)
	and object_type = 'PROCESS';
Line: 3394

FORALL v_ind IN 1..delete_row_cnt
	DELETE from amw_process
	where name = v_delete_list(v_ind);
Line: 3399

FORALL v_ind IN 1..delete_row_cnt
	update wf_activities
	set end_date = sysdate
	where name = v_delete_list(v_ind)
	and item_type = 'AUDITMGR'
	and end_date is null;
Line: 3412

v_child_name.delete;
Line: 3415

v_delete_list.delete;
Line: 3416

v_delete_pid_list.delete;
Line: 3422

update amw_process ap1
set ap1.standard_variation =
(select ap2.process_id from amw_process ap2 where ap2.process_id = ap1.standard_variation);
Line: 3431

    delete from amw_exceptions_b where exception_id = l_ex_id;
Line: 3432

    delete from amw_exceptions_reasons where exception_id = l_ex_id;
Line: 3433

    delete from amw_exceptions_tl where exception_id = l_ex_id;
Line: 3438

delete from amw_process a where not exists
(select name from wf_activities w where w.name = a.name and w.item_type = 'AUDITMGR' and w.end_date is null);