Saturday 23 June 2012

Delete Item Classification Query in Oracle Apps

Excise Rezime Code

---********* To Delete Attributes ***********---

DELETE FROM jai_rgm_itm_tmpl_attrs att
      WHERE EXISTS (
               SELECT 1
                 FROM jai_rgm_itm_regns rgm
                WHERE rgm.rgm_item_regns_id = att.rgm_item_regns_id
                  AND rgm.regime_code = 'EXCISE'
                  AND EXISTS (
                         SELECT 1
                           FROM mtl_system_items_b msii
                          WHERE msii.inventory_item_id = rgm.inventory_item_id
                            AND msii.organization_id = :P_ORGN_ID))
                      
---******* Delete Item Classification for EXCISE Rezime Item ********
delete
FROM jai_rgm_itm_regns rgm
           WHERE  rgm.regime_code = 'EXCISE'
             AND EXISTS (
                    SELECT 1
                      FROM mtl_system_items_items_b msii
                     WHERE msii.inventory_item_id = rgm.inventory_item_id
                       AND msii.organization_id = :P_ORGN_ID)


VAT Rezime Code

---********* To Delete Attributes ***********---

DELETE FROM jai_rgm_itm_tmpl_attrs att
      WHERE EXISTS (
               SELECT 1
                 FROM jai_rgm_itm_regns rgm
                WHERE rgm.rgm_item_regns_id = att.rgm_item_regns_id
                  AND rgm.regime_code = 'VAT'
                  AND EXISTS (
                         SELECT 1
                           FROM mtl_system_items_items_b msii
                          WHERE msii.inventory_item_id = rgm.inventory_item_id
                            AND msii.organization_id = :P_ORGN_ID))
                      
---******* Delete Item Classification for VAT Rezime Item ********
delete
FROM jai_rgm_itm_regns rgm
           WHERE  rgm.regime_code = 'VAT'
             AND EXISTS (
                    SELECT 1
                      FROM mtl_system_items_items_b msii
                     WHERE msii.inventory_item_id = rgm.inventory_item_id
                       AND msii.organization_id = :P_ORGN_ID)

No comments:

Post a Comment