DBA Data[Home] [Help]

APPS.IBE_PROD_RELATION_PVT SQL Statements

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

Line: 5

PROCEDURE Insert_Relationship(
   p_api_version       IN  NUMBER                     ,
   p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
   p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
   x_return_status     OUT NOCOPY VARCHAR2                   ,
   x_msg_count         OUT NOCOPY NUMBER                     ,
   x_msg_data          OUT NOCOPY VARCHAR2                   ,
   p_rel_type_code     IN  VARCHAR2                   ,
   p_description       IN  VARCHAR2 := NULL           ,
   p_start_date_active IN  DATE     := NULL           ,
   p_end_date_active   IN  DATE     := NULL
)
IS
   L_API_NAME    CONSTANT VARCHAR2(30) := 'Insert_Relationship';
Line: 28

   SAVEPOINT Insert_Relationship_PVT;
Line: 48

      IBE_UTIL.debug('IBE_Prod_Relation_PVT.Insert_Relationship(+)');
Line: 53

     fnd_lookup_values_pkg.insert_row
       (
       X_ROWID                       => l_rowid,
       X_LOOKUP_TYPE                 => 'IBE_RELATIONSHIP_TYPES',
       X_VIEW_APPLICATION_ID         => l_view_application_id,
       X_LOOKUP_CODE                 => p_rel_type_code,
       X_TAG                         => NULL,
       X_ATTRIBUTE_CATEGORY          => NULL,
       X_ATTRIBUTE1                  => NULL,
       X_ATTRIBUTE2                  => NULL,
       X_ATTRIBUTE3                  => NULL,
       X_ATTRIBUTE4                  => NULL,
       X_ENABLED_FLAG                => 'Y',
       X_START_DATE_ACTIVE           => p_start_date_active,
       X_END_DATE_ACTIVE             => p_end_date_active,
       X_TERRITORY_CODE              => NULL,
       X_ATTRIBUTE5                  => NULL,
       X_ATTRIBUTE6                  => NULL,
       X_ATTRIBUTE7                  => NULL,
       X_ATTRIBUTE8                  => NULL,
       X_ATTRIBUTE9                  => NULL,
       X_ATTRIBUTE10                 => NULL,
       X_ATTRIBUTE11                 => NULL,
       X_ATTRIBUTE12                 => NULL,
       X_ATTRIBUTE13                 => NULL,
       X_ATTRIBUTE14                 => NULL,
       X_ATTRIBUTE15                 => NULL,
       X_MEANING                     => p_rel_type_code,
       X_DESCRIPTION                 => p_description,
       X_CREATION_DATE               => sysdate,
       X_CREATED_BY                  => l_user_id,
       X_LAST_UPDATE_DATE            => sysdate,
       X_LAST_UPDATED_BY             => l_user_id,
       X_LAST_UPDATE_LOGIN           => FND_GLOBAL.login_id
       );
Line: 92

           IBE_UTIL.debug('Insert statement failed.');
Line: 99

           IBE_UTIL.debug('Insert statement failed.');
Line: 114

      IBE_UTIL.debug('IBE_Prod_Relation_PVT.Insert_Relationship(-)');
Line: 129

      ROLLBACK TO Insert_Relationship_PVT;
Line: 136

      ROLLBACK TO Insert_Relationship_PVT;
Line: 143

      ROLLBACK TO Insert_Relationship_PVT;
Line: 153

END Insert_Relationship;
Line: 156

PROCEDURE Update_Relationship(
   p_api_version   IN  NUMBER                     ,
   p_init_msg_list IN  VARCHAR2 := FND_API.G_FALSE,
   p_commit        IN  VARCHAR2 := FND_API.G_FALSE,
   x_return_status OUT NOCOPY VARCHAR2                   ,
   x_msg_count     OUT NOCOPY NUMBER                     ,
   x_msg_data      OUT NOCOPY VARCHAR2                   ,
   p_rel_type_code IN  VARCHAR2                   ,
   p_description   IN  VARCHAR2                   ,
   p_start_date    IN  DATE                       ,
   p_end_date      IN  DATE
)
IS
   L_API_NAME    CONSTANT VARCHAR2(30) := 'Update_Relationship';
Line: 179

   SAVEPOINT Update_Relationship_PVT;
Line: 199

      IBE_UTIL.debug('IBE_Prod_Relation_PVT.Update_Relationship(+)');
Line: 203

     fnd_lookup_values_pkg.update_row
       (
       X_LOOKUP_TYPE                 => 'IBE_RELATIONSHIP_TYPES',
       X_VIEW_APPLICATION_ID         => l_view_application_id,
       X_LOOKUP_CODE                 => p_rel_type_code,
       X_TAG                         => NULL,
       X_ATTRIBUTE_CATEGORY          => NULL,
       X_ATTRIBUTE1                  => NULL,
       X_ATTRIBUTE2                  => NULL,
       X_ATTRIBUTE3                  => NULL,
       X_ATTRIBUTE4                  => NULL,
       X_ENABLED_FLAG                => 'Y',
       X_START_DATE_ACTIVE           => p_start_date,
       X_END_DATE_ACTIVE             => p_end_date,
       X_TERRITORY_CODE              => NULL,
       X_ATTRIBUTE5                  => NULL,
       X_ATTRIBUTE6                  => NULL,
       X_ATTRIBUTE7                  => NULL,
       X_ATTRIBUTE8                  => NULL,
       X_ATTRIBUTE9                  => NULL,
       X_ATTRIBUTE10                 => NULL,
       X_ATTRIBUTE11                 => NULL,
       X_ATTRIBUTE12                 => NULL,
       X_ATTRIBUTE13                 => NULL,
       X_ATTRIBUTE14                 => NULL,
       X_ATTRIBUTE15                 => NULL,
       X_MEANING                     => p_rel_type_code,
       X_DESCRIPTION                 => p_description,
       X_LAST_UPDATE_DATE            => sysdate,
       X_LAST_UPDATED_BY             => l_user_id,
       X_LAST_UPDATE_LOGIN           => FND_GLOBAL.login_id
       );
Line: 238

           IBE_UTIL.debug('Update statement failed.');
Line: 245

           IBE_UTIL.debug('Update statement failed.');
Line: 260

      IBE_UTIL.debug('IBE_Prod_Relation_PVT.Update_Relationship(-)');
Line: 274

      ROLLBACK TO Update_Relationship_PVT;
Line: 281

      ROLLBACK TO Update_Relationship_PVT;
Line: 288

      ROLLBACK TO Update_Relationship_PVT;
Line: 299

END Update_Relationship;
Line: 302

PROCEDURE Update_Relationship_Detail(
   p_api_version   IN  NUMBER                     ,
   p_init_msg_list IN  VARCHAR2 := FND_API.G_FALSE,
   p_commit        IN  VARCHAR2 := FND_API.G_FALSE,
   x_return_status OUT NOCOPY VARCHAR2                   ,
   x_msg_count     OUT NOCOPY NUMBER                     ,
   x_msg_data      OUT NOCOPY VARCHAR2                   ,
   p_rel_type_code IN  VARCHAR2                   ,
   p_meaning       IN  VARCHAR2                   ,
   p_description   IN  VARCHAR2                   ,
   p_start_date    IN  DATE                       ,
   p_end_date      IN  DATE
)
IS
   L_API_NAME    CONSTANT VARCHAR2(30) := 'Update_Relationship_Detail';
Line: 326

   SAVEPOINT Update_Relationship_Detail_PVT;
Line: 346

      IBE_UTIL.debug('IBE_Prod_Relation_PVT.Update_Relationship_Detail(+)');
Line: 350

     fnd_lookup_values_pkg.update_row
       (
       X_LOOKUP_TYPE                 => 'IBE_RELATIONSHIP_TYPES',
       X_VIEW_APPLICATION_ID         => l_view_application_id,
       X_LOOKUP_CODE                 => p_rel_type_code,
       X_TAG                         => NULL,
       X_ATTRIBUTE_CATEGORY          => NULL,
       X_ATTRIBUTE1                  => NULL,
       X_ATTRIBUTE2                  => NULL,
       X_ATTRIBUTE3                  => NULL,
       X_ATTRIBUTE4                  => NULL,
       X_ENABLED_FLAG                => 'Y',
       X_START_DATE_ACTIVE           => p_start_date,
       X_END_DATE_ACTIVE             => p_end_date,
       X_TERRITORY_CODE              => NULL,
       X_ATTRIBUTE5                  => NULL,
       X_ATTRIBUTE6                  => NULL,
       X_ATTRIBUTE7                  => NULL,
       X_ATTRIBUTE8                  => NULL,
       X_ATTRIBUTE9                  => NULL,
       X_ATTRIBUTE10                 => NULL,
       X_ATTRIBUTE11                 => NULL,
       X_ATTRIBUTE12                 => NULL,
       X_ATTRIBUTE13                 => NULL,
       X_ATTRIBUTE14                 => NULL,
       X_ATTRIBUTE15                 => NULL,
       X_MEANING                     => p_meaning,
       X_DESCRIPTION                 => p_description,
       X_LAST_UPDATE_DATE            => sysdate,
       X_LAST_UPDATED_BY             => l_user_id,
       X_LAST_UPDATE_LOGIN           => FND_GLOBAL.login_id
       );
Line: 385

           IBE_UTIL.debug('Update statement failed.');
Line: 392

           IBE_UTIL.debug('Update statement failed.');
Line: 407

      IBE_UTIL.debug('IBE_Prod_Relation_PVT.Update_Relationship_Detail(-)');
Line: 421

      ROLLBACK TO Update_Relationship_Detail_PVT;
Line: 428

      ROLLBACK TO Update_Relationship_Detail_PVT;
Line: 435

      ROLLBACK TO Update_Relationship_Detail_PVT;
Line: 446

END Update_Relationship_Detail;
Line: 449

PROCEDURE Delete_Relationships(
   p_api_version       IN  NUMBER                     ,
   p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
   p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
   x_return_status     OUT NOCOPY VARCHAR2                   ,
   x_msg_count         OUT NOCOPY NUMBER                     ,
   x_msg_data          OUT NOCOPY VARCHAR2                   ,
   p_rel_type_code_tbl IN  JTF_Varchar2_Table_100
)
IS
   L_API_NAME    CONSTANT VARCHAR2(30) := 'Delete_Relationships';
Line: 468

   SAVEPOINT Delete_Relationship_PVT;
Line: 492

      IBE_UTIL.debug('IBE_Prod_Relation_PVT.Delete_Relationship(+)');
Line: 498

       fnd_lookup_values_pkg.delete_row
         (
         X_LOOKUP_TYPE             => 'IBE_RELATIONSHIP_TYPES',
         X_VIEW_APPLICATION_ID     => l_view_application_id,
         X_LOOKUP_CODE             => p_rel_type_code_tbl(i)
         );
Line: 508

             IBE_UTIL.debug('Delete statement failed.');
Line: 515

             IBE_UTIL.debug('Delete statement failed.');
Line: 534

      DELETE
        FROM ibe_ct_relation_rules
       WHERE relation_type_code = p_rel_type_code_tbl(i);
Line: 542

      DELETE
        FROM ibe_ct_related_items
       WHERE relation_type_code = p_rel_type_code_tbl(i);
Line: 550

      DELETE
        FROM ibe_ct_rel_exclusions
       WHERE relation_type_code = p_rel_type_code_tbl(i);
Line: 555

      IBE_UTIL.debug('IBE_Prod_Relation_PVT.Delete_Relationship(-)');
Line: 569

      ROLLBACK TO Delete_Relationship_PVT;
Line: 576

      ROLLBACK TO Delete_Relationship_PVT;
Line: 583

      ROLLBACK TO Delete_Relationship_PVT;
Line: 594

END Delete_Relationships;
Line: 642

      INSERT INTO IBE_CT_REL_EXCLUSIONS(
         organization_id, relation_type_code, inventory_item_id,
         related_item_id, object_version_number, created_by,
         creation_date, last_updated_by, last_update_date
      )
      VALUES(
         L_ORGANIZATION_ID, p_rel_type_code, p_inventory_item_id_tbl(i),
         p_related_item_id_tbl(i), 1, L_USER_ID,
         SYSDATE, L_USER_ID, SYSDATE
      );
Line: 741

      DELETE
      FROM IBE_CT_REL_EXCLUSIONS
      WHERE relation_type_code = p_rel_type_code
        AND inventory_item_id  = p_inventory_item_id_tbl(i)
        AND related_item_id    = p_related_item_id_tbl(i)
	   AND organization_id    = L_ORGANIZATION_ID;  --Bug 2922902
Line: 792

PROCEDURE Insert_Related_Items_Rows(
   p_rel_type_code      IN VARCHAR2,
   p_rel_rule_id        IN NUMBER  ,
   p_origin_object_type IN VARCHAR2,
   p_dest_object_type   IN VARCHAR2,
   p_origin_object_id   IN NUMBER  ,
   p_dest_object_id     IN NUMBER
) IS
BEGIN
  Insert_Related_Items_Rows(
    p_rel_type_code,
    p_rel_rule_id,
    p_origin_object_type,
    p_dest_object_type,
    p_origin_object_id,
    p_dest_object_id,
    L_ORGANIZATION_ID
   );
Line: 811

END Insert_Related_Items_Rows;
Line: 815

PROCEDURE Insert_Related_Items_Rows(
   p_rel_type_code      IN VARCHAR2,
   p_rel_rule_id        IN NUMBER  ,
   p_origin_object_type IN VARCHAR2,
   p_dest_object_type   IN VARCHAR2,
   p_origin_object_id   IN NUMBER  ,
   p_dest_object_id     IN NUMBER  ,
   p_organization_id    IN NUMBER
)
IS
   L_USER_ID CONSTANT NUMBER := FND_GLOBAL.User_ID;
Line: 840

      INSERT INTO IBE_CT_RELATED_ITEMS(
         organization_id, relation_type_code, relation_rule_id, inventory_item_id,
         related_item_id, object_version_number, created_by, creation_date,
         last_updated_by, last_update_date
      )
      SELECT JDSI1.organization_id, p_rel_type_code, p_rel_rule_id, JDSI1.inventory_item_id,
             JDSI2.inventory_item_id, 1, L_USER_ID, SYSDATE,
             L_USER_ID, SYSDATE
      FROM IBE_DSP_SECTION_ITEMS JDSI1,
           IBE_DSP_SECTION_ITEMS JDSI2
      WHERE JDSI1.section_id = p_origin_object_id
        AND JDSI2.section_id = p_dest_object_id
	   AND JDSI1.organization_id = JDSI2.organization_id; --Bug 2922902
Line: 855

      INSERT INTO IBE_CT_RELATED_ITEMS(
         organization_id, relation_type_code, relation_rule_id, inventory_item_id,
         related_item_id, object_version_number, created_by, creation_date,
         last_updated_by, last_update_date
      )
      SELECT DISTINCT MIC.organization_id, p_rel_type_code, p_rel_rule_id,
                      JDSI.inventory_item_id, MIC.inventory_item_id, 1,
                      L_USER_ID, SYSDATE, L_USER_ID, SYSDATE
      FROM IBE_DSP_SECTION_ITEMS JDSI,
           MTL_ITEM_CATEGORIES MIC
      WHERE JDSI.section_id     = p_origin_object_id
        AND MIC.organization_id = JDSI.organization_id  --Bug 2922902
        AND MIC.category_id     = p_dest_object_id
	   AND MIC.category_set_id = l_category_set_id_str;  --Bug 2630696
Line: 871

      INSERT INTO IBE_CT_RELATED_ITEMS(
         organization_id, relation_type_code, relation_rule_id, inventory_item_id,
         related_item_id, object_version_number, created_by, creation_date,
         last_updated_by, last_update_date
      )
      SELECT p_organization_id, p_rel_type_code, p_rel_rule_id, JDSI.inventory_item_id,
             p_dest_object_id, 1, L_USER_ID, SYSDATE,
             L_USER_ID, SYSDATE
      FROM IBE_DSP_SECTION_ITEMS JDSI
      WHERE JDSI.section_id = p_origin_object_id
        AND JDSI.organization_id = p_organization_id;  --Bug 2922902
Line: 884

      INSERT INTO IBE_CT_RELATED_ITEMS(
         organization_id, relation_type_code, relation_rule_id, inventory_item_id,
         related_item_id, object_version_number, created_by, creation_date,
         last_updated_by, last_update_date
      )
      SELECT DISTINCT MIC.organization_id, p_rel_type_code, p_rel_rule_id, MIC.inventory_item_id,
             JDSI.inventory_item_id, 1, L_USER_ID, SYSDATE,
             L_USER_ID, SYSDATE
      FROM MTL_ITEM_CATEGORIES MIC,
           IBE_DSP_SECTION_ITEMS JDSI
      WHERE MIC.organization_id  = JDSI.organization_id  --Bug 2922902
        AND MIC.category_id      = p_origin_object_id
        AND JDSI.section_id      = p_dest_object_id
	   AND MIC.category_set_id  = l_category_set_id_str; --Bug 2630696
Line: 900

      INSERT INTO IBE_CT_RELATED_ITEMS(
         organization_id, relation_type_code, relation_rule_id, inventory_item_id,
         related_item_id, object_version_number, created_by, creation_date,
         last_updated_by, last_update_date
      )
      SELECT DISTINCT MIC1.organization_id, p_rel_type_code, p_rel_rule_id, MIC1.inventory_item_id,
             MIC2.inventory_item_id, 1, L_USER_ID, SYSDATE,
             L_USER_ID, SYSDATE
      FROM MTL_ITEM_CATEGORIES MIC1,
           MTL_ITEM_CATEGORIES MIC2
      WHERE MIC1.organization_id = MIC2.organization_id  --Bug 2922902
        AND MIC1.category_id     = p_origin_object_id
        AND MIC2.category_id     = p_dest_object_id
	   AND MIC1.organization_id = MIC2.organization_id   --Bug 2630696
	   AND MIC1.category_set_id = MIC2.category_set_id   --Bug 2630696
	   AND MIC1.category_set_id = l_category_set_id_str; --bug 2630696
Line: 918

      INSERT INTO IBE_CT_RELATED_ITEMS(
         organization_id, relation_type_code, relation_rule_id, inventory_item_id,
         related_item_id, object_version_number, created_by, creation_date,
         last_updated_by, last_update_date
      )
      SELECT DISTINCT p_organization_id, p_rel_type_code, p_rel_rule_id, MIC.inventory_item_id,
             p_dest_object_id, 1, L_USER_ID, SYSDATE,
             L_USER_ID, SYSDATE
      FROM MTL_ITEM_CATEGORIES MIC
      WHERE MIC.organization_id = p_organization_id
        AND MIC.category_id     = p_origin_object_id
	   AND MIC.category_set_id = l_category_set_id_str; --Bug 2630696
Line: 932

      INSERT INTO IBE_CT_RELATED_ITEMS(
         organization_id, relation_type_code, relation_rule_id, inventory_item_id,
         related_item_id, object_version_number, created_by, creation_date,
         last_updated_by, last_update_date
      )
      SELECT p_organization_id, p_rel_type_code, p_rel_rule_id, p_origin_object_id,
             JDSI.inventory_item_id, 1, L_USER_ID, SYSDATE,
             L_USER_ID, SYSDATE
      FROM IBE_DSP_SECTION_ITEMS JDSI
      WHERE JDSI.section_id      = p_dest_object_id
	   AND JDSI.organization_id = p_organization_id;  --Bug 2922902
Line: 945

      INSERT INTO IBE_CT_RELATED_ITEMS(
         organization_id, relation_type_code, relation_rule_id, inventory_item_id,
         related_item_id, object_version_number, created_by, creation_date,
         last_updated_by, last_update_date
      )
      SELECT DISTINCT p_organization_id, p_rel_type_code, p_rel_rule_id, p_origin_object_id,
             MIC.inventory_item_id, 1, L_USER_ID, SYSDATE,
             L_USER_ID, SYSDATE
      FROM MTL_ITEM_CATEGORIES MIC
      WHERE MIC.organization_id = p_organization_id
        AND MIC.category_id     = p_dest_object_id
	   AND MIC.category_set_id = l_category_set_id_str; --Bug 2630696
Line: 959

      INSERT INTO IBE_CT_RELATED_ITEMS(
         organization_id, relation_type_code, relation_rule_id, inventory_item_id,
         related_item_id, object_version_number, created_by, creation_date,
         last_updated_by, last_update_date
      )
      VALUES(
         p_organization_id, p_rel_type_code, p_rel_rule_id, p_origin_object_id,
         p_dest_object_id, 1, L_USER_ID, SYSDATE,
         L_USER_ID, SYSDATE
      );
Line: 970

END Insert_Related_Items_Rows;
Line: 976

   DELETE
   FROM IBE_CT_REL_EXCLUSIONS ICRE
   WHERE NOT EXISTS( SELECT NULL
                     FROM IBE_CT_RELATED_ITEMS ICRI
                     WHERE ICRI.relation_type_code = ICRE.relation_type_code
                       AND ICRI.inventory_item_id  = ICRE.inventory_item_id
				   AND ICRI.organization_id = ICRE.organization_id --Bug 2922902
                       AND ICRI.related_item_id    = ICRE.related_item_id );
Line: 987

PROCEDURE Item_Category_Inserted(
   p_category_id       IN NUMBER,
   p_inventory_item_id IN NUMBER,
   p_organization_id   IN NUMBER DEFAULT NULL) --Bug 2922902,3001591
IS
   TYPE rel_rule_csr_type IS REF CURSOR;
Line: 1001

   OPEN l_rel_rule_csr FOR 'SELECT relation_type_code, relation_rule_id, dest_object_type, dest_object_id ' ||
                           'FROM ibe_ct_relation_rules ' ||
                           'WHERE origin_object_type = ''C'' ' ||
                             'AND origin_object_id = :category_id '
                       USING p_category_id;
Line: 1012

      Insert_Related_Items_Rows( p_rel_type_code      => l_rel_type_code    ,
                                 p_rel_rule_id        => l_rel_rule_id      ,
                                 p_origin_object_type => 'I'                ,
                                 p_dest_object_type   => l_object_type      ,
                                 p_origin_object_id   => p_inventory_item_id,
                                 p_dest_object_id     => l_object_id        ,
         /*Bug 3001591*/         p_organization_id    => L_ORGANIZATION_ID);
Line: 1020

      Insert_Related_Items_Rows( p_rel_type_code      => l_rel_type_code    ,
                                 p_rel_rule_id        => l_rel_rule_id      ,
                                 p_origin_object_type => 'I'                ,
                                 p_dest_object_type   => l_object_type      ,
                                 p_origin_object_id   => p_inventory_item_id,
                                 p_dest_object_id     => l_object_id        ,
         /*Bug 2922902*/         p_organization_id    => p_organization_id);
Line: 1032

   OPEN l_rel_rule_csr FOR 'SELECT relation_type_code, relation_rule_id, origin_object_type, origin_object_id ' ||
                           'FROM ibe_ct_relation_rules ' ||
                           'WHERE dest_object_type = ''C'' ' ||
                             'AND dest_object_id = :category_id '
                       USING p_category_id;
Line: 1043

      Insert_Related_Items_Rows( p_rel_type_code      => l_rel_type_code    ,
                                 p_rel_rule_id        => l_rel_rule_id      ,
                                 p_origin_object_type => l_object_type      ,
                                 p_dest_object_type   => 'I'                ,
                                 p_origin_object_id   => l_object_id        ,
                                 p_dest_object_id     => p_inventory_item_id ,
         /*Bug 3001591*/         p_organization_id    => L_ORGANIZATION_ID);
Line: 1051

      Insert_Related_Items_Rows( p_rel_type_code      => l_rel_type_code    ,
                                 p_rel_rule_id        => l_rel_rule_id      ,
                                 p_origin_object_type => l_object_type      ,
                                 p_dest_object_type   => 'I'                ,
                                 p_origin_object_id   => l_object_id        ,
                                 p_dest_object_id     => p_inventory_item_id ,
         /*Bug 2922902*/         p_organization_id    => p_organization_id);
Line: 1062

END Item_Category_Inserted;
Line: 1065

PROCEDURE Item_Section_Inserted(
   p_section_id        IN NUMBER,
   p_inventory_item_id IN NUMBER,
   p_organization_id   IN NUMBER DEFAULT NULL)  --Bug 2922902,3001591
IS
   TYPE rel_rule_csr_type IS REF CURSOR;
Line: 1079

   OPEN l_rel_rule_csr FOR 'SELECT relation_type_code, relation_rule_id, dest_object_type, dest_object_id ' ||
                           'FROM ibe_ct_relation_rules ' ||
                           'WHERE origin_object_type = ''S'' ' ||
                             'AND origin_object_id = :section_id ' ||
                             'AND relation_type_code <> ''AUTOPLACEMENT'' '
                       USING p_section_id;
Line: 1091

      Insert_Related_Items_Rows( p_rel_type_code      => l_rel_type_code    ,
                                 p_rel_rule_id        => l_rel_rule_id      ,
                                 p_origin_object_type => 'I'                ,
                                 p_dest_object_type   => l_object_type      ,
                                 p_origin_object_id   => p_inventory_item_id,
                                 p_dest_object_id     => l_object_id        ,
       /*Bug 3001591*/           p_organization_id    => L_ORGANIZATION_ID);
Line: 1099

      Insert_Related_Items_Rows( p_rel_type_code      => l_rel_type_code    ,
                                 p_rel_rule_id        => l_rel_rule_id      ,
                                 p_origin_object_type => 'I'                ,
                                 p_dest_object_type   => l_object_type      ,
                                 p_origin_object_id   => p_inventory_item_id,
                                 p_dest_object_id     => l_object_id        ,
       /*Bug 2922902*/           p_organization_id    => p_organization_id);
Line: 1111

   OPEN l_rel_rule_csr FOR 'SELECT relation_type_code, relation_rule_id, origin_object_type, origin_object_id ' ||
                           'FROM ibe_ct_relation_rules ' ||
                           'WHERE dest_object_type = ''S'' ' ||
                             'AND dest_object_id = :section_id '
                       USING p_section_id;
Line: 1122

      Insert_Related_Items_Rows( p_rel_type_code      => l_rel_type_code    ,
                                 p_rel_rule_id        => l_rel_rule_id      ,
                                 p_origin_object_type => l_object_type      ,
                                 p_dest_object_type   => 'I'                ,
                                 p_origin_object_id   => l_object_id        ,
                                 p_dest_object_id     => p_inventory_item_id,
      /*Bug 3001591*/            p_organization_id    => L_ORGANIZATION_ID);
Line: 1130

      Insert_Related_Items_Rows( p_rel_type_code      => l_rel_type_code    ,
                                 p_rel_rule_id        => l_rel_rule_id      ,
                                 p_origin_object_type => l_object_type      ,
                                 p_dest_object_type   => 'I'                ,
                                 p_origin_object_id   => l_object_id        ,
                                 p_dest_object_id     => p_inventory_item_id,
      /*Bug 2922902*/            p_organization_id    => p_organization_id);
Line: 1141

END Item_Section_Inserted;
Line: 1144

PROCEDURE Item_Category_Deleted(
   p_category_id       IN NUMBER,
   p_inventory_item_id IN NUMBER,
   p_organization_id   IN NUMBER DEFAULT NULL) --Bug 2922902,3001591
IS
   TYPE rel_rule_csr_type IS REF CURSOR;
Line: 1156

   OPEN l_rel_rule_csr FOR 'SELECT relation_type_code, ' ||
                                  'relation_rule_id ' ||
                           'FROM ibe_ct_relation_rules ' ||
                           'WHERE origin_object_type = ''C'' ' ||
                             'AND origin_object_id = :category_id '
                       USING p_category_id;
Line: 1170

        DELETE IBE_CT_RELATED_ITEMS
        WHERE relation_type_code = l_relation_type_code
          AND relation_rule_id   = l_rel_rule_id
          AND inventory_item_id  = p_inventory_item_id
	     AND organization_id = L_ORGANIZATION_ID; --Bug 3001591
Line: 1176

        DELETE IBE_CT_RELATED_ITEMS
        WHERE relation_type_code = l_relation_type_code
          AND relation_rule_id   = l_rel_rule_id
          AND inventory_item_id  = p_inventory_item_id
	     AND organization_id = p_organization_id; --Bug 2922902
Line: 1188

   OPEN l_rel_rule_csr FOR 'SELECT relation_type_code, ' ||
                                  'relation_rule_id ' ||
                           'FROM ibe_ct_relation_rules ' ||
                           'WHERE dest_object_type = ''C'' ' ||
                             'AND dest_object_id = :category_id '
                       USING p_category_id;
Line: 1203

        DELETE IBE_CT_RELATED_ITEMS
        WHERE relation_type_code = l_relation_type_code
          AND relation_rule_id   = l_rel_rule_id
          AND related_item_id    = p_inventory_item_id
	     AND organization_id    = L_ORGANIZATION_ID; --Bug 3001591
Line: 1209

        DELETE IBE_CT_RELATED_ITEMS
        WHERE relation_type_code = l_relation_type_code
          AND relation_rule_id   = l_rel_rule_id
          AND related_item_id    = p_inventory_item_id
	     AND organization_id    = p_organization_id; --Bug 2922902
Line: 1220

END Item_Category_Deleted;
Line: 1223

PROCEDURE Item_Section_Deleted(
   p_section_id        IN NUMBER,
   p_inventory_item_id IN NUMBER,
   p_organization_id   IN NUMBER DEFAULT NULL)  --Bug 2922902,3001591
IS
   TYPE rel_rule_csr_type IS REF CURSOR;
Line: 1235

   OPEN l_rel_rule_csr FOR 'SELECT relation_type_code, '||
                                  'relation_rule_id ' ||
                           'FROM ibe_ct_relation_rules ' ||
                           'WHERE origin_object_type = ''S'' ' ||
                             'AND origin_object_id = :section_id ' ||
                             'AND relation_type_code <> ''AUTOPLACEMENT'' '
                       USING p_section_id;
Line: 1251

        DELETE IBE_CT_RELATED_ITEMS
        WHERE relation_type_code = l_relation_type_code
          AND relation_rule_id  = l_rel_rule_id
          AND inventory_item_id = p_inventory_item_id
	     AND organization_id  = L_ORGANIZATION_ID; --Bug 3001591
Line: 1257

        DELETE IBE_CT_RELATED_ITEMS
        WHERE relation_type_code = l_relation_type_code
          AND relation_rule_id  = l_rel_rule_id
          AND inventory_item_id = p_inventory_item_id
	     AND organization_id  = p_organization_id; --Bug 2922902
Line: 1268

   OPEN l_rel_rule_csr FOR 'SELECT relation_type_code, ' ||
                                  'relation_rule_id ' ||
                           'FROM ibe_ct_relation_rules ' ||
                           'WHERE dest_object_type = ''S'' ' ||
                             'AND dest_object_id = :section_id '
                       USING p_section_id;
Line: 1283

        DELETE IBE_CT_RELATED_ITEMS
        WHERE relation_type_code = l_relation_type_code
          AND relation_rule_id = l_rel_rule_id
          AND related_item_id  = p_inventory_item_id
	     AND organization_id  = L_ORGANIZATION_ID; --Bug 3001591
Line: 1289

        DELETE IBE_CT_RELATED_ITEMS
        WHERE relation_type_code = l_relation_type_code
          AND relation_rule_id = l_rel_rule_id
          AND related_item_id  = p_inventory_item_id
	     AND organization_id  = p_organization_id; --Bug 2922902
Line: 1300

END Item_Section_Deleted;
Line: 1303

PROCEDURE Category_Deleted(
   p_category_id IN NUMBER)
IS
BEGIN
   -- 1. Delete all the rules where origin_object_type is Category
   --    and origin_object_id is p_section_id
   DELETE IBE_CT_RELATION_RULES
    WHERE origin_object_type = 'C'
      AND origin_object_id  = p_category_id;
Line: 1315

   DELETE IBE_CT_RELATION_RULES
    WHERE dest_object_type = 'C'
      AND dest_object_id  = p_category_id;
Line: 1318

END Category_Deleted;
Line: 1321

PROCEDURE Section_Deleted(p_section_id IN NUMBER)
IS
BEGIN
   -- 1. Delete all the rules where origin_object_type is Section
   --    and origin_object_id is p_section_id
   DELETE IBE_CT_RELATION_RULES
    WHERE origin_object_type = 'S'
      AND origin_object_id  = p_section_id;
Line: 1332

   DELETE IBE_CT_RELATION_RULES
    WHERE dest_object_type = 'S'
      AND dest_object_id  = p_section_id;
Line: 1335

END Section_Deleted;
Line: 1338

PROCEDURE Item_Inserted(p_inventory_item_id IN NUMBER)
IS
BEGIN
   NULL;
Line: 1342

END Item_Inserted;
Line: 1345

PROCEDURE Item_Deleted(
   p_organization_id   IN NUMBER,
   p_inventory_item_id IN NUMBER
)
IS
BEGIN
   -- 1. Remove all the rules that have the deleted item
   --    as an origin object
   DELETE
   FROM ibe_ct_relation_rules
   WHERE origin_object_type = 'I'
     AND origin_object_id   = p_inventory_item_id;
Line: 1360

   DELETE
   FROM ibe_ct_relation_rules
   WHERE dest_object_type = 'I'
     AND dest_object_id   = p_inventory_item_id;
Line: 1367

   DELETE
   FROM IBE_CT_RELATED_ITEMS
   WHERE inventory_item_id = p_inventory_item_id
     AND organization_id   = p_organization_id;
Line: 1374

   DELETE
   FROM IBE_CT_RELATED_ITEMS
   WHERE related_item_id = p_inventory_item_id
     AND organization_id = p_organization_id;
Line: 1380

END Item_Deleted;