DBA Data[Home] [Help]

APPS.OKC_TASK_PVT SQL Statements

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

Line: 43

		l_deleted_flag			jtf_tasks_b.deleted_flag%TYPE;
Line: 54

		--Select the rule details
/*		Cursor rules_cur(p_tve_id IN NUMBER) is
		select rule_information1 task_name
		      ,rule_information3 notification_period
		      ,rule_information4 resource_id
		      ,rule_information5 escalate_days
		from okc_rules_v
		where rule_information_category = 'NTN'
		and rule_information2 = p_tve_id;
Line: 67

		--Select the task_type
		Cursor task_cur is
		select task_type_id, name
		from jtf_task_types_vl
		where task_type_id = 23;
Line: 75

		--Select the task status
		Cursor status_cur is
		select task_status_id, name
		from jtf_task_statuses_vl
		where task_status_id = 10;
Line: 82

		--Select the object code
		Cursor object_cur is
		select object_code
		from jtf_objects_vl
		where object_code = 'OKC_RESTIME'
		and  object_code in (select object_code
				   from jtf_object_usages
				   where object_user_code = 'TASK');
Line: 91

		--Select the owner type code
		Cursor owner_type_cur is
		select object_code
  		from jtf_objects_vl
  		where object_code = 'OKX_TASKRES'
  		and  object_code in (select object_code
       				   from jtf_object_usages
       				   where object_user_code = 'RESOURCES');
Line: 101

		SELECT UOM_CODE FROM OKC_TIME_CODE_UNITS_B
		where tce_code = 'DAY'
		and rownum < 2;
Line: 118

	-- Select the rule details

        -- Resolve all values related to contracts
        -- Get the application_id and rule definition names
	   l_app_id := OKC_TIME_UTIL_PUB.get_app_id;
Line: 144

     l_sql_string := 'select r.rule_information1 task_name,r.rule_information3 notification_period,rule_information4 resource_id,rule_information5 escalate_days ' ||
	          	 'from okc_rules_b r '||
		           'where r.rule_information2 = to_char(:p_tve_id) ' ||
				 'and r.rule_information_category in '|| l_list_of_rules ||
			      'and r.rule_information_category in '|| l_list_of_rules1 ;
Line: 344

		l_deleted_flag			jtf_tasks_b.deleted_flag%TYPE;
Line: 353

		--Select task_type
		Cursor task_cur is
		select task_type_id, name
		from jtf_task_types_vl
		where task_type_id = 18;
Line: 361

		--Select task status
		Cursor status_cur is
		select task_status_id, name
		from jtf_task_statuses_vl
		where task_status_id = 9;
Line: 368

		--Select object code
		Cursor object_cur is
		select object_code
		from jtf_objects_vl
		where object_code = 'OKC_COND_OCCR'
		and  object_code in (select object_code
				   from jtf_object_usages
				   where object_user_code = 'TASK');
Line: 377

		--Select the owner type code
		Cursor owner_type_cur is
		select object_code
  		from jtf_objects_vl
  		where object_code = 'OKX_TASKRES'
  		and  object_code in (select object_code
       				   from jtf_object_usages
       				   where object_user_code = 'RESOURCES');
Line: 503

		l_deleted_flag			jtf_tasks_b.deleted_flag%TYPE;
Line: 510

		--Select task_type
		Cursor task_cur is
		select task_type_id, name
		from jtf_task_types_vl
		where task_type_id = 24;
Line: 518

		--Select task status
		Cursor status_cur is
		select task_status_id, name
		from jtf_task_statuses_vl
		where task_status_id = 9;
Line: 525

		--Select object code
		Cursor object_cur is
		select object_code
		from jtf_objects_vl
		where object_code = 'OKC_K_HEADER'
		and  object_code in (select object_code
				   from jtf_object_usages
				   where object_user_code = 'TASK');
Line: 534

		--Select the owner type code
		Cursor owner_type_cur is
		select object_code
  		from jtf_objects_vl
  		where object_code = 'OKX_TASKRES'
  		and  object_code in (select object_code
       				   from jtf_object_usages
       				   where object_user_code = 'RESOURCES');
Line: 633

    	-- Procedure Name  : update_task
    	-- Description     : Procedure to update a Task
    	-- Version         : 1.0
    	-- End of comments
	PROCEDURE update_task(p_api_version 		IN NUMBER
			     ,p_init_msg_list 		     IN VARCHAR2
			     ,p_object_version_number      IN OUT NOCOPY NUMBER
			     ,p_task_id			     IN NUMBER
			     ,p_task_number		          IN NUMBER
			     ,p_workflow_process_id	     IN NUMBER
			     ,p_actual_end_date       	IN DATE
			     ,p_alarm_fired_count          IN NUMBER
			     ,x_return_status   	OUT NOCOPY VARCHAR2
    			     ,x_msg_count       	OUT NOCOPY NUMBER
    			     ,x_msg_data        	OUT NOCOPY VARCHAR2) IS
          l_api_name          CONSTANT VARCHAR2(30) := 'update_task';
Line: 659

		--Select task status
		Cursor update_status_cur is
		select task_status_id, name
		from jtf_task_statuses_vl
		where task_status_id = 9;
Line: 667

		--Select task_status
		Cursor status_cur is
		select task_status_id, name
		from jtf_task_statuses_vl
		where task_status_id = 10;
Line: 676

      Select SOURCE_OBJECT_ID
            ,SOURCE_OBJECT_NAME
      From   jtf_tasks_b
      Where  task_id = p_task_id;
Line: 684

		--If the actual date is not null then update the status to Closed
		IF p_actual_end_date IS NOT NULL THEN
		    OPEN  update_status_cur;
Line: 687

		    FETCH  update_status_cur into l_close_status_id, l_close_status_name;
Line: 688

		    l_notfound := update_status_cur%NOTFOUND;
Line: 689

		    CLOSE update_status_cur;
Line: 720

		--Call to the procedure of public API JTF_TASKS_PUB to update a task
		jtf_tasks_pub.update_task(p_api_version  => p_api_version
			     		     ,p_init_msg_list 	     => p_init_msg_list
					        ,p_object_version_number => p_object_version_number
			     		     ,p_task_id		        => p_task_id
					        ,p_task_number		     => p_task_number
					        ,p_workflow_process_id  => p_workflow_process_id
			     		     ,p_actual_end_date      => p_actual_end_date
					        ,p_alarm_fired_count    => p_alarm_fired_count
					        ,p_task_status_id       => l_task_status_id
				           ,p_task_status_name	  => l_task_status_name
                       ,p_source_object_id     => l_source_object_id
                       ,p_source_object_name   => l_source_object_name
			     		     ,x_return_status   	  => x_return_status
    			     		  ,x_msg_count       	  => x_msg_count
    			     		  ,x_msg_data        	  => x_msg_data);
Line: 758

	END update_task;
Line: 761

    	-- Procedure Name  : delete_task
    	-- Description     : Procedure to delete a Task/s
    	-- Version         : 1.0
    	-- End of comments
	--Pass the p_tve_id(Time value ID) to delete multiple tasks(ex: When a rule is deleted)
	--Pass the p_rtv_id(Resolved Time ID) to delete a single task(ex: When a contract is terminated)
	PROCEDURE delete_task(p_api_version 		IN NUMBER
			     ,p_init_msg_list 	IN VARCHAR2
			     ,p_tve_id			IN NUMBER
			     ,p_rtv_id			IN NUMBER
			     ,x_return_status   	OUT NOCOPY VARCHAR2
    			     ,x_msg_count       	OUT NOCOPY NUMBER
    			     ,x_msg_data        	OUT NOCOPY VARCHAR2) IS

				l_api_name CONSTANT VARCHAR2(30) := 'delete_task';
Line: 777

		--Select task for a given resolved timevalue id
		Cursor delete_tasks_cur(p_rtv_id IN NUMBER, p_status_id IN NUMBER) IS
		select jtf.task_id, jtf.task_number, jtf.object_version_number
		from jtf_tasks_b jtf
		where jtf.source_object_id = p_rtv_id
		and jtf.source_object_type_code = 'OKC_RESTIME'
		and jtf.task_status_id = p_status_id;
Line: 786

		--Select task status
		Cursor delete_status_cur is
		select task_status_id
		from jtf_task_statuses_vl
		where task_status_id = 10;
Line: 793

		--Select all the resolved time values for a given timevalue id
		Cursor delete_rule_cur(p_tve_id IN NUMBER) IS
		select rtv.id
		from okc_resolved_timevalues rtv
		where rtv.tve_id = p_tve_id;
Line: 799

		TYPE delete_rec_type IS RECORD(
		  task_id      		jtf_tasks_b.task_id%TYPE,
		  task_number  		jtf_tasks_b.task_number%TYPE,
		  object_version_number	jtf_tasks_b.object_version_number%TYPE);
Line: 803

		TYPE delete_tasks_tbl_type IS TABLE OF delete_rec_type
		INDEX BY BINARY_INTEGER;
Line: 805

		delete_tasks_tbl  delete_tasks_tbl_type;
Line: 807

		delete_ctr	NUMBER := 0;
Line: 814

	   --If the timevalue ID is not null then delete all the tasks for a rule with status = 'Open'
	   IF p_tve_id IS NOT NULL THEN
	     OPEN delete_status_cur;
Line: 817

	     FETCH delete_status_cur into l_status_id;
Line: 818

	     CLOSE delete_status_cur;
Line: 820

	     FOR delete_rule_rec in delete_rule_cur(p_tve_id) LOOP
		FOR delete_tasks_rec in delete_tasks_cur(p_rtv_id => delete_rule_rec.id,
							 p_status_id => l_status_id) LOOP
			delete_ctr := delete_ctr + 1;
Line: 824

			delete_tasks_tbl (delete_ctr).task_id := delete_tasks_rec.task_id;
Line: 825

			delete_tasks_tbl (delete_ctr).task_number := delete_tasks_rec.task_number;
Line: 826

			delete_tasks_tbl (delete_ctr).object_version_number := delete_tasks_rec.object_version_number;
Line: 830

	    IF delete_tasks_tbl.COUNT > 0 THEN
	    i := delete_tasks_tbl.FIRST;
Line: 833

		--Call the procedure of public API JTF_TASKS_PUB to delete tasks
		jtf_tasks_pub.delete_task(p_api_version    	  => p_api_version
			     		     ,p_init_msg_list  	  => p_init_msg_list
					          ,p_object_version_number => delete_tasks_tbl(i).object_version_number
			     		     ,p_task_id        	  => delete_tasks_tbl(i).task_id
					          ,p_task_number	   	  => delete_tasks_tbl(i).task_number
			     		     ,x_return_status  	  => x_return_status
    			     		     ,x_msg_count      	  => x_msg_count
    			     		     ,x_msg_data       	  => x_msg_data);
Line: 842

		EXIT WHEN (i = delete_tasks_tbl.LAST);
Line: 843

		i := delete_tasks_tbl.NEXT(i);
Line: 848

	 --If the resolved timevalue id is not null then delete a single task
	 -- where source_object_id(JTF_TASKS_B) = p_rtv_id(resolved timevalue ID)
	 -- and the status is OKCOPEN
	 IF p_rtv_id IS NOT NULL THEN
	     OPEN delete_status_cur;
Line: 853

	     FETCH delete_status_cur into l_status_id;
Line: 854

	     CLOSE delete_status_cur;
Line: 855

		FOR delete_tasks_rec in delete_tasks_cur(p_rtv_id => p_rtv_id, p_status_id => l_status_id) LOOP
	         	delete_ctr := delete_ctr + 1;
Line: 857

			delete_tasks_tbl (delete_ctr).task_id := delete_tasks_rec.task_id;
Line: 858

			delete_tasks_tbl (delete_ctr).task_number := delete_tasks_rec.task_number;
Line: 859

			delete_tasks_tbl (delete_ctr).object_version_number := delete_tasks_rec.object_version_number;
Line: 862

	    IF delete_tasks_tbl.COUNT > 0 THEN
	    i := delete_tasks_tbl.FIRST;
Line: 865

		--Call to the procedure of public API JTF_TASKS_PUB to delete tasks
		jtf_tasks_pub.delete_task(p_api_version    	  => p_api_version
			     		     ,p_init_msg_list  	  => p_init_msg_list
					          ,p_object_version_number => delete_tasks_tbl(i).object_version_number
			     		     ,p_task_id        	  => delete_tasks_tbl(i).task_id
					          ,p_task_number	   	  => delete_tasks_tbl(i).task_number
			     		     ,x_return_status  	  => x_return_status
    			     		     ,x_msg_count      	  => x_msg_count
    			     		     ,x_msg_data       	  => x_msg_data);
Line: 874

		EXIT WHEN (i = delete_tasks_tbl.LAST);
Line: 875

		i := delete_tasks_tbl.NEXT(i);
Line: 902

	END delete_task;