Clarity

 View Only
  • 1.  Tech Tip: INV_FLAT_HIERARCHIES has outdated and orphaned data

    Broadcom Employee
    Posted Mar 12, 2020 02:49 PM
    Hello everyone, I would like to share a solution I recently worked on with a customer, and hope this is helpful!


    INV_FLAT_HIERARCHIES has outdated and orphaned data, due to having parents, grandparents, great grandparents etc we cannot easily delete them. How to safely repopulate this table?

    1. On your Test environment, backup table INV_FLAT_HIERARCHIES
    2. Now run the code below:
    declare

        cursor h is select child_id, parent_id from INV_HIERARCHIES where parent_id is not null;

    begin

        execute immediate 'truncate table INV_FLAT_HIERARCHIES';

        FOR h_rec IN h

        LOOP

            INV_HIERS_FLAT_INSERT(h_rec.CHILD_ID, h_rec.PARENT_ID);

        end loop;

    end;

     

    This will truncate the table INV_FLAT_HIERARCHIES, and completely repopulate it from INV_HIERARCHIES, using the OOTB stored procedure. It will not copy any of the "orphans" or any self lines for any projects that's no longer have hierarchies, and it will only insert the records needed.

    1. Verify the data before moving the solution to Production environment 


    ------------------------------
    Sr Principal Support Engineer, Broadcom
    ------------------------------


  • 2.  RE: Tech Tip: INV_FLAT_HIERARCHIES has outdated and orphaned data

    Broadcom Employee
    Posted Mar 12, 2020 02:50 PM
    KB https://ca-broadcom.wolkenservicedesk.com/external/article?articleId=186434


  • 3.  RE: Tech Tip: INV_FLAT_HIERARCHIES has outdated and orphaned data

     
    Posted Mar 13, 2020 01:57 PM
    Thank you for the tip Nika!

    ------------------------------
    Chris Hackett
    Community Manager, Broadcom Enterprise Software Division
    Broadcom Inc.
    ------------------------------