DBA Data[Home] [Help]

APPS.PSB_ACCOUNT_POSITION_SET_PVT SQL Statements

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

Line: 22

 |                       PROCEDURE Insert_Row                            |
 +=======================================================================*/
PROCEDURE Insert_Row
(
  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,
  p_return_status             OUT  NOCOPY      VARCHAR2,
  p_msg_count                 OUT  NOCOPY      NUMBER,
  p_msg_data                  OUT  NOCOPY      VARCHAR2,
  --
  p_row_id                    IN OUT  NOCOPY   VARCHAR2,
  p_account_position_set_id   IN OUT  NOCOPY   NUMBER,
  p_name                      IN       VARCHAR2,
  p_set_of_books_id           IN       NUMBER,
  p_use_in_budget_group_flag  IN       VARCHAR2 := FND_API.G_MISS_CHAR,
  p_data_extract_id           IN       NUMBER,
  p_budget_group_id           IN       NUMBER := FND_API.G_MISS_NUM,
  p_global_or_local_type      IN       VARCHAR2,
  p_account_or_position_type  IN       VARCHAR2,
  p_attribute_selection_type  IN       VARCHAR2,
  p_business_group_id         IN       NUMBER,
  p_last_update_date          IN       DATE,
  p_last_updated_by           IN       NUMBER,
  p_last_update_login         IN       NUMBER,
  p_created_by                IN       NUMBER,
  p_creation_date             IN       DATE
)
IS
  --
  l_api_name            CONSTANT VARCHAR2(30)   := 'Insert_Row';
Line: 57

    SELECT rowid
    FROM   psb_account_position_sets
    WHERE  account_position_set_id = p_account_position_set_id;
Line: 62

    SELECT psb_account_position_sets_s.nextval
    FROM   dual;
Line: 66

  SAVEPOINT Insert_Row_Pvt ;
Line: 91

  INSERT INTO psb_account_position_sets(
	 account_position_set_id,
	 name,
	 set_of_books_id,
	 use_in_budget_group_flag,
	 data_extract_id,
	 budget_group_id,
	 global_or_local_type,
	 account_or_position_type,
	 attribute_selection_type,
	 business_group_id,
	 last_update_date,
	 last_updated_by,
	 last_update_login,
	 created_by,
	 creation_date )
      VALUES
      (
	 p_account_position_set_id,
	 p_name,
	 p_set_of_books_id,
	 DECODE(p_use_in_budget_group_flag,
		FND_API.G_MISS_CHAR, NULL,
		p_use_in_budget_group_flag),
	 p_data_extract_id,
	 DECODE(p_budget_group_id,FND_API.G_MISS_NUM,null,p_budget_group_id),
	 p_global_or_local_Type,
	 p_account_or_position_Type,
	 p_attribute_selection_Type,
	 p_business_group_Id,
	 p_last_update_date,
	 p_last_updated_by,
	 p_last_update_login,
	 p_created_by,
	 p_creation_date
      );
Line: 148

    ROLLBACK TO Insert_Row_Pvt ;
Line: 155

    ROLLBACK TO Insert_Row_Pvt ;
Line: 162

    ROLLBACK TO Insert_Row_Pvt ;
Line: 173

END Insert_Row;
Line: 200

  p_attribute_selection_type  IN       VARCHAR2,
  p_business_group_id         IN       NUMBER,
  --
  p_row_locked                OUT  NOCOPY      VARCHAR2
)
IS
  --
  l_api_name            CONSTANT VARCHAR2(30)   := 'Lock_Row';
Line: 212

       SELECT *
       FROM   psb_account_position_sets
       WHERE  rowid = p_row_id
       FOR UPDATE of Account_Position_Set_Id NOWAIT;
Line: 243

    FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
Line: 285

	  AND ( (Recinfo.attribute_selection_type = p_attribute_selection_type)
		 OR ( (Recinfo.attribute_selection_type IS NULL)
		       AND (p_attribute_selection_type IS NULL)))

	  AND ( (Recinfo.business_group_id =  p_business_group_id)
		 OR (Recinfo.business_group_id IS NULL)
		     AND (p_business_group_id IS NULL)))

  THEN
    Null;
Line: 352

 |                       PROCEDURE Update_Row                               |
 +==========================================================================*/
PROCEDURE Update_Row
(
  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,
  p_return_status             OUT  NOCOPY      VARCHAR2,
  p_msg_count                 OUT  NOCOPY      NUMBER,
  p_msg_data                  OUT  NOCOPY      VARCHAR2,
  --
  p_row_id                    IN       VARCHAR2,
  p_account_position_set_id   IN       NUMBER,
  p_name                      IN       VARCHAR2,
  p_set_of_books_id           IN       NUMBER,
  p_use_in_budget_group_flag  IN       VARCHAR2 := FND_API.G_MISS_CHAR,
  p_data_extract_id           IN       NUMBER,
  p_budget_group_id           IN       NUMBER := FND_API.G_MISS_NUM,
  p_global_or_local_type      IN       VARCHAR2,
  p_account_or_position_type  IN       VARCHAR2,
  p_attribute_selection_type  IN       VARCHAR2,
  p_business_group_id         IN       NUMBER,
  p_last_update_date          IN       DATE,
  p_last_updated_by           IN       NUMBER,
  p_last_update_login         IN       NUMBER
)
IS
  --
  l_api_name            CONSTANT VARCHAR2(30)   := 'Update_Row';
Line: 386

  SAVEPOINT Update_Row_Pvt ;
Line: 404

  UPDATE psb_account_position_sets
  SET
    account_position_set_id  = p_account_position_set_id,
    name                     = p_name,
    set_of_books_id          = p_set_of_books_id,
    use_in_budget_group_flag = DECODE( p_use_in_budget_group_flag,
				       FND_API.G_MISS_CHAR, NULL,
				       p_use_in_budget_group_flag),
    data_extract_id          = p_data_extract_id,
    budget_group_id          = DECODE( p_budget_group_id,
				       FND_API.G_MISS_NUM,null,
				       p_budget_group_id),
    global_or_local_type     = p_global_or_local_type,
    account_or_position_type = p_account_or_position_type,
    attribute_selection_type = p_attribute_selection_type,
    business_group_id        = p_business_group_id,
    last_update_date         = p_last_update_date,
    last_updated_by          = p_last_updated_by,
    last_update_login        = p_last_update_login
  WHERE rowid = p_row_id;
Line: 441

    ROLLBACK TO Update_Row_Pvt ;
Line: 448

    ROLLBACK TO Update_Row_Pvt ;
Line: 455

    ROLLBACK TO Update_Row_Pvt ;
Line: 466

END Update_Row;
Line: 472

 |                       PROCEDURE Delete_Row                               |
 +==========================================================================*/
PROCEDURE Delete_Row
(
  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,
  p_return_status             OUT  NOCOPY      VARCHAR2,
  p_msg_count                 OUT  NOCOPY      NUMBER,
  p_msg_data                  OUT  NOCOPY      VARCHAR2,
  --
  p_row_id                    IN        VARCHAR2
)
IS
  --
  l_api_name                CONSTANT VARCHAR2(30)   := 'Delete_Row';
Line: 500

  SAVEPOINT Delete_Row_Pvt ;
Line: 523

  SELECT account_position_set_id INTO l_account_position_set_id
  FROM   psb_account_position_sets
  WHERE  rowid = p_row_id ;
Line: 534

    SELECT rowid
    FROM   psb_account_position_set_lines
    WHERE  account_position_set_id = l_account_position_set_id
  )
  LOOP
    --
    PSB_Acct_Position_Set_Line_Pvt.Delete_Row
    (
       p_api_version             =>   1.0 ,
       p_init_msg_list           =>   FND_API.G_FALSE,
       p_commit                  =>   FND_API.G_FALSE,
       p_validation_level        =>   FND_API.G_VALID_LEVEL_FULL,
       p_return_status           =>   l_return_status,
       p_msg_count               =>   l_msg_count,
       p_msg_data                =>   l_msg_data,
       --
       p_row_id                  =>   l_lines_rec.rowid
    );
Line: 562

  DELETE FROM psb_account_position_sets
  WHERE rowid = p_row_id;
Line: 581

    ROLLBACK TO Delete_Row_Pvt ;
Line: 588

    ROLLBACK TO Delete_Row_Pvt ;
Line: 595

    ROLLBACK TO Delete_Row_Pvt ;
Line: 606

END Delete_Row;
Line: 638

    SELECT '1'
    FROM   psb_account_position_sets
    WHERE  name                     = p_name
    AND    account_or_position_type = p_account_or_position_type
    AND    ( p_data_extract_id IS NULL
	     OR
	     data_extract_id = p_data_extract_id
	   )
    AND    (
	     p_row_id IS NULL
	     OR
	     rowid <> p_row_id
	   );
Line: 753

    SELECT '1'
    FROM   psb_set_relations
    WHERE  account_position_set_id = p_account_position_set_id;
Line: 758

    SELECT '1'
    FROM   psb_budget_groups
    WHERE  root_budget_group = 'Y'
    AND    budget_group_type = 'R'
    AND    ( ps_account_position_set_id = p_account_position_set_id
	     OR
	     nps_account_position_set_id = p_account_position_set_id
	   ) ;
Line: 768

    SELECT '1'
    FROM   psb_budget_groups
    WHERE  root_budget_group = 'Y'
    AND    budget_group_type = 'R'
    AND    NVL(freeze_hierarchy_flag, 'N') = 'Y'
    AND    ( ps_account_position_set_id = p_account_position_set_id
	     OR
	     nps_account_position_set_id = p_account_position_set_id
	   ) ;
Line: 831

  SELECT NVL(use_in_budget_group_flag, 'N') INTO l_use_in_budget_group_flag
  FROM   psb_account_position_sets
  WHERE  account_position_set_id = p_account_position_set_id;
Line: 860

	SELECT DECODE( bg.root_budget_group, 'Y', bg.budget_group_id,
		       bg.root_budget_group_id ) as root_budget_group_id
	FROM   psb_set_relations rel,
	       psb_budget_groups bg
	WHERE  rel.account_position_set_id = p_account_position_set_id
	AND    bg.budget_group_type        = 'R'
	AND    bg.budget_group_id          = rel.budget_group_id
      )
      LOOP

	SELECT NVL(freeze_hierarchy_flag, 'N') into l_freeze_hierarchy_flag
	FROM   psb_budget_groups
	WHERE  budget_group_id = l_budget_group_csr.root_budget_group_id;
Line: 965

	 SELECT business_group_id
	 FROM   psb_data_extracts
	 WHERE  data_extract_id = p_source_data_extract_id ;
Line: 970

	 SELECT business_group_id
	 FROM   psb_data_extracts
	 WHERE  data_extract_id = p_target_data_extract_id ;
Line: 1045

    SELECT *
    FROM   psb_account_position_sets
    WHERE  account_or_position_type = 'P'
    AND    global_or_local_type     = 'G'
    AND    data_extract_id          = p_source_data_extract_id
  )
  LOOP

    Copy_Position_Set
    (
      p_api_version              => 1.0,
      p_init_msg_list            => FND_API.G_TRUE,
      p_commit                   => FND_API.G_FALSE,
      p_validation_level         => FND_API.G_VALID_LEVEL_FULL,
      p_return_status            => l_return_status,
      p_msg_count                => l_msg_count,
      p_msg_data                 => l_msg_data,
      --
      p_source_position_set_id   => l_global_sets_rec.account_position_set_id ,
      p_source_data_extract_id   => p_source_data_extract_id,
      p_target_data_extract_id   => p_target_data_extract_id,
      p_target_business_group_id => l_target_business_group_id,
      p_new_position_set_id      => l_new_position_set_id
    ) ;
Line: 1091

      SELECT sets.account_position_set_id
      FROM   psb_set_relations          rels ,
	     psb_account_position_sets  sets
      WHERE  sets.account_position_set_id  = rels.account_position_set_id
      AND    sets.account_or_position_type = 'P'
      AND    sets.global_or_local_type     = 'L'
      AND    sets.data_extract_id          = p_source_data_extract_id
      AND    DECODE( p_entity_table(i) ,
			'BWR', budget_workflow_rule_id,
			'C',   constraint_id,
			'DR',  default_rule_id,
			'P',   parameter_id,
			'PSG', position_set_group_id
		    ) IS NOT NULL
    )
    LOOP

      --
      Copy_Position_Set
      (
	p_api_version              => 1.0,
	p_init_msg_list            => FND_API.G_TRUE,
	p_commit                   => FND_API.G_FALSE,
	p_validation_level         => FND_API.G_VALID_LEVEL_FULL,
	p_return_status            => l_return_status,
	p_msg_count                => l_msg_count,
	p_msg_data                 => l_msg_data,
	--
	p_source_position_set_id   => l_local_sets_rec.account_position_set_id,
	p_source_data_extract_id   => p_source_data_extract_id,
	p_target_data_extract_id   => p_target_data_extract_id,
	p_target_business_group_id => l_target_business_group_id,
	p_new_position_set_id      => l_new_position_set_id
      ) ;
Line: 1228

	 SELECT *
	 FROM   psb_account_position_sets
	 WHERE  account_position_set_id = p_source_position_set_id ;
Line: 1237

	 SELECT attribute_id
	 FROM   psb_attributes_VL
	 WHERE  business_group_id          = p_target_business_group_id
	 AND    name                       = c_name
	 AND    allow_in_position_set_flag = 'Y' ;
Line: 1248

	 SELECT attribute_value_id
	 FROM   psb_attribute_values
	 WHERE  data_extract_id = p_target_data_extract_id
	 AND    attribute_id    = l_target_attribute_id
	 AND    attribute_value = c_attribute_value ;
Line: 1289

  SELECT count(*) INTO l_count
  FROM   psb_account_position_sets
  WHERE  account_position_set_id <> l_sets_rec.account_position_set_id
  AND    name                     = l_sets_rec.name
  AND    data_extract_id          = p_target_data_extract_id ;
Line: 1307

  PSB_Account_Position_Set_Pvt.Insert_Row
  (
    p_api_version                  => 1.0,
    p_init_msg_list                => FND_API.G_TRUE,
    p_commit                       => FND_API.G_FALSE,
    p_validation_level             => FND_API.G_VALID_LEVEL_FULL,
    p_return_status                => l_return_status,
    p_msg_count                    => l_msg_count,
    p_msg_data                     => l_msg_data,
    --
    p_row_id                       => l_row_id,
    p_account_position_set_id      => l_account_position_set_id,
    p_name                         => l_sets_rec.name,
    p_set_of_books_id              => l_sets_rec.set_of_books_id,
    p_data_extract_id              => p_target_data_extract_id,
    p_budget_group_id              => l_sets_rec.budget_group_id,
    p_global_or_local_type         => l_sets_rec.global_or_local_type,
    p_account_or_position_type     => l_sets_rec.account_or_position_type,
    p_attribute_selection_type     => l_sets_rec.attribute_selection_type,
    p_business_group_id            => p_target_business_group_id,
    p_last_update_date             => l_current_date,
    p_last_updated_by              => l_current_user_id,
    p_last_update_login            => l_current_login_id,
    p_created_by                   => l_current_user_id,
    p_creation_date                => l_current_date
  );
Line: 1350

    SELECT *
    FROM   psb_acct_position_set_lines_v
    WHERE  account_position_set_id = p_source_position_set_id
  )
  LOOP


    -- Find the matching attribute in the target data extract.
    OPEN  l_find_matching_attribute_csr ( l_lines_rec.attribute_name ) ;
Line: 1374

    PSB_Acct_Position_Set_Line_Pvt.Insert_Row
    (
      p_api_version             => 1.0,
      p_init_msg_list           => FND_API.G_TRUE,
      p_commit                  => FND_API.G_FALSE,
      p_validation_level        => FND_API.G_VALID_LEVEL_FULL,
      p_return_status           => l_return_status,
      p_msg_count               => l_msg_count,
      p_msg_data                => l_msg_data,
      --
      p_row_id                  => l_row_id,
      p_line_sequence_id        => l_line_sequence_id,
      p_account_position_set_id => l_account_position_set_id,
      p_description             => l_lines_rec.description,
      p_business_group_id       => p_target_business_group_id,
      p_attribute_id            => l_target_attribute_id,
      p_include_or_exclude_type => l_lines_rec.include_or_exclude_type,
      p_segment1_low            => l_lines_rec.segment1_low,
      p_segment2_low            => l_lines_rec.segment2_low,
      p_segment3_low            => l_lines_rec.segment3_low,
      p_segment4_low            => l_lines_rec.segment4_low,
      p_segment5_low            => l_lines_rec.segment5_low,
      p_segment6_low            => l_lines_rec.segment6_low,
      p_segment7_low            => l_lines_rec.segment7_low,
      p_segment8_low            => l_lines_rec.segment8_low,
      p_segment9_low            => l_lines_rec.segment9_low,
      p_segment10_low           => l_lines_rec.segment10_low,
      p_segment11_low           => l_lines_rec.segment11_low,
      p_segment12_low           => l_lines_rec.segment12_low,
      p_segment13_low           => l_lines_rec.segment13_low,
      p_segment14_low           => l_lines_rec.segment14_low,
      p_segment15_low           => l_lines_rec.segment15_low,
      p_segment16_low           => l_lines_rec.segment16_low,
      p_segment17_low           => l_lines_rec.segment17_low,
      p_segment18_low           => l_lines_rec.segment18_low,
      p_segment19_low           => l_lines_rec.segment19_low,
      p_segment20_low           => l_lines_rec.segment20_low,
      p_segment21_low           => l_lines_rec.segment21_low,
      p_segment22_low           => l_lines_rec.segment22_low,
      p_segment23_low           => l_lines_rec.segment23_low,
      p_segment24_low           => l_lines_rec.segment24_low,
      p_segment25_low           => l_lines_rec.segment25_low,
      p_segment26_low           => l_lines_rec.segment26_low,
      p_segment27_low           => l_lines_rec.segment27_low,
      p_segment28_low           => l_lines_rec.segment28_low,
      p_segment29_low           => l_lines_rec.segment29_low,
      p_segment30_low           => l_lines_rec.segment30_low,
      p_segment1_high           => l_lines_rec.segment1_high,
      p_segment2_high           => l_lines_rec.segment2_high,
      p_segment3_high           => l_lines_rec.segment3_high,
      p_segment4_high           => l_lines_rec.segment4_high,
      p_segment5_high           => l_lines_rec.segment5_high,
      p_segment6_high           => l_lines_rec.segment6_high,
      p_segment7_high           => l_lines_rec.segment7_high,
      p_segment8_high           => l_lines_rec.segment8_high,
      p_segment9_high           => l_lines_rec.segment9_high,
      p_segment10_high          => l_lines_rec.segment10_high,
      p_segment11_high          => l_lines_rec.segment11_high,
      p_segment12_high          => l_lines_rec.segment12_high,
      p_segment13_high          => l_lines_rec.segment13_high,
      p_segment14_high          => l_lines_rec.segment14_high,
      p_segment15_high          => l_lines_rec.segment15_high,
      p_segment16_high          => l_lines_rec.segment16_high,
      p_segment17_high          => l_lines_rec.segment17_high,
      p_segment18_high          => l_lines_rec.segment18_high,
      p_segment19_high          => l_lines_rec.segment19_high,
      p_segment20_high          => l_lines_rec.segment20_high,
      p_segment21_high          => l_lines_rec.segment21_high,
      p_segment22_high          => l_lines_rec.segment22_high,
      p_segment23_high          => l_lines_rec.segment23_high,
      p_segment24_high          => l_lines_rec.segment24_high,
      p_segment25_high          => l_lines_rec.segment25_high,
      p_segment26_high          => l_lines_rec.segment26_high,
      p_segment27_high          => l_lines_rec.segment27_high,
      p_segment28_high          => l_lines_rec.segment28_high,
      p_segment29_high          => l_lines_rec.segment29_high,
      p_segment30_high          => l_lines_rec.segment30_high,
      p_context                 => l_lines_rec.context,
      p_attribute1              => l_lines_rec.attribute1,
      p_attribute2              => l_lines_rec.attribute2,
      p_attribute3              => l_lines_rec.attribute3,
      p_attribute4              => l_lines_rec.attribute4,
      p_attribute5              => l_lines_rec.attribute5,
      p_attribute6              => l_lines_rec.attribute6,
      p_attribute7              => l_lines_rec.attribute7,
      p_attribute8              => l_lines_rec.attribute8,
      p_attribute9              => l_lines_rec.attribute9,
      p_attribute10             => l_lines_rec.attribute10,
      p_last_update_date        => l_current_date,
      p_last_updated_by         => l_current_user_id,
      p_last_update_login       => l_current_login_id,
      p_created_by              => l_current_user_id,
      p_creation_date           => l_current_date
    );
Line: 1484

      SELECT *
      FROM   psb_position_set_line_values_v
      WHERE  line_sequence_id = l_lines_rec.line_sequence_id
    )
    LOOP

      --
      -- We need to find matching attribute_value_id only when value_table
      -- flag is 'Y', otherwise every value is good.
      --
      IF l_values_rec.attribute_value_table_flag = 'Y' THEN

	-- Find the matching attribute_value_id.
	-- ( The l_values_rec.attribute_value will be null. )
	OPEN  l_find_matching_value_csr ( l_values_rec.attribute_table_value );
Line: 1521

      PSB_Pos_Set_Line_Values_Pvt.Insert_Row
      (
	 p_api_version           => 1.0,
	 p_init_msg_list         => FND_API.G_TRUE,
	 p_commit                => FND_API.G_FALSE,
	 p_validation_level      => FND_API.G_VALID_LEVEL_FULL,
	 p_return_status         => l_return_status,
	 p_msg_count             => l_msg_count,
	 p_msg_data              => l_msg_data,
	 --
	 p_row_id                => l_row_id,
	 p_value_sequence_id     => l_value_sequence_id,
	 p_line_sequence_id      => l_line_sequence_id,
	 p_attribute_value_id    => l_target_attribute_value_id,
	 p_attribute_value       => l_values_rec.attribute_value,
	 p_last_update_date      => l_current_date,
	 p_last_updated_by       => l_current_user_id,
	 p_last_update_login     => l_current_login_id,
	 p_created_by            => l_current_user_id,
	 p_creation_date         => l_current_date
      );