DBA Data[Home] [Help]

APPS.CN_SRP_PLAN_ASSIGNS_PVT SQL Statements

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

Line: 42

      SELECT *
	INTO l_role_plans_row
	FROM cn_role_plans
	WHERE role_plan_id = p_role_plan_id;
Line: 62

      SELECT *
	INTO l_srp_roles_row
	FROM cn_srp_roles
	WHERE srp_role_id = p_srp_role_id
	  AND org_id = l_role_plans_row.org_id;  --MOAC
Line: 100

   SELECT count(1)
     INTO l_temp_count
     FROM cn_srp_pay_groups
    WHERE salesrep_id = x_srp_plan_assigns_row.salesrep_id
      AND org_id = x_srp_plan_assigns_row.org_id; -- MOAC
Line: 112

      SELECT MIN(start_date), MAX(start_date)
	INTO l_srp_pay_grp_sd, l_spg_max_sd
	FROM cn_srp_pay_groups
       WHERE salesrep_id = x_srp_plan_assigns_row.salesrep_id
	 AND org_id = x_srp_plan_assigns_row.org_id; -- MOAC
Line: 119

        SELECT Decode(spg.end_date, NULL, pg.end_date,spg.end_date),
	       spg.pay_group_id
  	  INTO l_srp_pay_grp_ed,l_pay_group_id
	  FROM cn_srp_pay_groups spg, cn_pay_groups pg
	 WHERE spg.pay_group_id = pg.pay_group_id
	   AND   spg.salesrep_id = x_srp_plan_assigns_row.salesrep_id
	   AND   spg.org_id      = x_srp_plan_assigns_row.org_id  -- MOAC
	   AND   spg.start_date = l_spg_max_sd;
Line: 184

	 SELECT 1 INTO l_dummy FROM dual
	   WHERE NOT EXISTS
	   (SELECT 1
	    FROM cn_srp_plan_assigns
	    WHERE role_plan_id = p_role_plan_id
	    AND   srp_role_id = p_srp_role_id);
Line: 255

   l_list.DELETE;
Line: 290

         select start_date, end_date
         from cn_srp_pay_groups
         where salesrep_id = srp_id
           and org_id = l_org_id; -- MOAC
Line: 312

   x_loading_status := 'CN_INSERTED';
Line: 332

      x_loading_status := 'CN_INSERTED';
Line: 336

	 cn_srp_plan_assigns_pkg.insert_row
	   (x_srp_plan_assign_id    => x_srp_plan_assign_id
	    ,x_srp_role_id          => l_spa_row.srp_role_id
	    ,x_role_plan_id         => l_spa_row.role_plan_id
	    ,x_salesrep_id          => l_spa_row.salesrep_id
	    ,x_role_id              => l_spa_row.role_id
	    ,x_comp_plan_id         => l_spa_row.comp_plan_id
	 ,x_start_date           => l_spa_row.start_date
	 ,x_end_date             => l_spa_row.end_date
	    ,x_created_by            => FND_GLOBAL.USER_ID
	    ,x_creation_date         => sysdate
	    ,x_last_update_date      => sysdate
	    ,x_last_updated_by       => FND_GLOBAL.USER_ID
	    ,x_last_update_login     => FND_GLOBAL.LOGIN_ID
	    ,x_attribute_category    => p_attribute_rec.attribute_category
	    ,x_attribute1            => p_attribute_rec.attribute1
	    ,x_attribute2            => p_attribute_rec.attribute2
	    ,x_attribute3            => p_attribute_rec.attribute3
	    ,x_attribute4            => p_attribute_rec.attribute4
	    ,x_attribute5            => p_attribute_rec.attribute5
	    ,x_attribute6            => p_attribute_rec.attribute6
	    ,x_attribute7            => p_attribute_rec.attribute7
	    ,x_attribute8            => p_attribute_rec.attribute8
	    ,x_attribute9            => p_attribute_rec.attribute9
	    ,x_attribute10           => p_attribute_rec.attribute10
	    ,x_attribute11           => p_attribute_rec.attribute11
	    ,x_attribute12           => p_attribute_rec.attribute12
	    ,x_attribute13           => p_attribute_rec.attribute13
	    ,x_attribute14           => p_attribute_rec.attribute14
	    ,x_attribute15           => p_attribute_rec.attribute15
	     );
Line: 419

	 -- insert all child records
	 cn_srp_quota_assigns_pkg.insert_record
	   (x_srp_plan_assign_id => x_srp_plan_assign_id
	    ,x_quota_id	   => null);
Line: 481

PROCEDURE Update_Srp_Plan_Assigns
  (
   p_api_version        IN    NUMBER,
   p_init_msg_list      IN    VARCHAR2 := FND_API.G_FALSE,
   p_commit	        IN    VARCHAR2 := FND_API.G_FALSE,
   p_validation_level   IN    NUMBER   := FND_API.G_VALID_LEVEL_FULL,
   x_return_status      OUT NOCOPY   VARCHAR2,
   x_msg_count	        OUT NOCOPY   NUMBER,
   x_msg_data	        OUT NOCOPY   VARCHAR2,
   p_srp_role_id        IN    NUMBER,
   p_role_plan_id       IN    NUMBER,
   p_attribute_rec      IN    CN_GLOBAL_VAR.attribute_rec_type := CN_GLOBAL_VAR.G_MISS_ATTRIBUTE_REC,
   x_loading_status     OUT NOCOPY   VARCHAR2
)  IS

      l_api_name     CONSTANT VARCHAR2(30) := 'Update_Srp_Plan_Assigns';
Line: 510

         select start_date, end_date
         from cn_srp_pay_groups
         where salesrep_id = srp_id
           and org_id = l_org_id; --MOAC
Line: 518

   SAVEPOINT	Update_Srp_Plan_Assigns;
Line: 531

   x_loading_status := 'CN_UPDATED';
Line: 535

      SELECT * INTO l_spa_row
	FROM cn_srp_plan_assigns
	WHERE srp_role_id = p_srp_role_id
	AND   role_plan_id = p_role_plan_id;
Line: 555

	    GOTO end_of_update_srp_plan_assigns;
Line: 578

      Delete_Srp_Plan_Assigns
	(p_api_version          => 1.0,
	 x_return_status        => x_return_status,
	 x_msg_count            => x_msg_count,
	 x_msg_data             => x_msg_data,
	 p_srp_role_id          => p_srp_role_id,
	 p_role_plan_id         => p_role_plan_id,
	 x_loading_status       => x_loading_status
	 );
Line: 590

	 x_loading_status := 'CN_UPDATED';
Line: 594

      cn_srp_plan_assigns_pkg.update_row
	(x_srp_plan_assign_id   => l_spa_row.srp_plan_assign_id
	 ,x_srp_role_id         => l_spa_row.srp_role_id
	 ,x_role_plan_id         => l_spa_row.role_plan_id
	 ,x_salesrep_id          => l_spa_row.salesrep_id
	 ,x_role_id              => l_spa_row.role_id
	 ,x_comp_plan_id         => l_spa_row.comp_plan_id
	 ,x_start_date           => l_spa_row.start_date
	 ,x_end_date             => l_spa_row.end_date
	 ,x_last_update_date     => sysdate
	 ,x_last_updated_by       => fnd_global.user_id
	 ,x_last_update_login     => fnd_global.login_id
	 ,x_attribute_category    => p_attribute_rec.attribute_category
	 ,x_attribute1            => p_attribute_rec.attribute1
	 ,x_attribute2            => p_attribute_rec.attribute2
	 ,x_attribute3            => p_attribute_rec.attribute3
	 ,x_attribute4            => p_attribute_rec.attribute4
	 ,x_attribute5            => p_attribute_rec.attribute5
	 ,x_attribute6            => p_attribute_rec.attribute6
	 ,x_attribute7            => p_attribute_rec.attribute7
	,x_attribute8            => p_attribute_rec.attribute8
	,x_attribute9            => p_attribute_rec.attribute9
	,x_attribute10           => p_attribute_rec.attribute10
	,x_attribute11           => p_attribute_rec.attribute11
	,x_attribute12           => p_attribute_rec.attribute12
	,x_attribute13           => p_attribute_rec.attribute13
	,x_attribute14           => p_attribute_rec.attribute14
	,x_attribute15           => p_attribute_rec.attribute15
	);
Line: 668

   << end_of_update_srp_plan_assigns >>
     NULL;
Line: 684

      ROLLBACK TO   Update_Srp_Plan_Assigns;
Line: 693

      ROLLBACK TO Update_Srp_Plan_Assigns;
Line: 703

      ROLLBACK TO Update_Srp_Plan_Assigns;
Line: 716

END Update_Srp_Plan_Assigns;
Line: 723

PROCEDURE Delete_Srp_Plan_Assigns
  (
   p_api_version        IN    NUMBER,
   p_init_msg_list      IN    VARCHAR2 := FND_API.G_FALSE,
   p_commit	        IN    VARCHAR2 := FND_API.G_FALSE,
   p_validation_level   IN    NUMBER   := FND_API.G_VALID_LEVEL_FULL,
   x_return_status      OUT NOCOPY   VARCHAR2,
   x_msg_count	        OUT NOCOPY   NUMBER,
   x_msg_data	        OUT NOCOPY   VARCHAR2,
   p_srp_role_id        IN    NUMBER,
   p_role_plan_id       IN    NUMBER,
   x_loading_status     OUT NOCOPY   VARCHAR2
)  IS

      l_api_name     CONSTANT VARCHAR2(30) := 'Delete_Srp_Plan_Assigns';
Line: 743

   SAVEPOINT	Delete_Srp_Plan_Assigns;
Line: 756

   x_loading_status := 'CN_DELETED';
Line: 760

      SELECT srp_plan_assign_id INTO l_srp_plan_assign_id
	FROM cn_srp_plan_assigns
	WHERE srp_role_id = p_srp_role_id
	AND   role_plan_id = p_role_plan_id;
Line: 773

	 -- CN_SRP_PLAN_ASSIGNS_NOT_EXIST, nothing to delete, exit api
	 GOTO end_of_delete_srp_plan_assigns;
Line: 777

   cn_srp_quota_assigns_pkg.delete_record
     (x_srp_plan_assign_id => l_srp_plan_assign_id
      ,x_quota_id	      => null);
Line: 782

   cn_srp_plan_assigns_pkg.delete_row
     (x_srp_plan_assign_id   => l_srp_plan_assign_id);
Line: 785

   << end_of_delete_srp_plan_assigns >>
     NULL;
Line: 801

      ROLLBACK TO   Delete_Srp_Plan_Assigns;
Line: 810

      ROLLBACK TO Delete_Srp_Plan_Assigns;
Line: 820

      ROLLBACK TO Delete_Srp_Plan_Assigns;
Line: 833

END Delete_Srp_Plan_Assigns;