But my suggestion to try is:
– Create a Excel with data retrieve from location with parent and create sql statement llike this:
insert into locancestor ( location, ancestor, systemid, siteid, orgid, locancestorid) values (‘MECSCTR’, ‘MEC’, ‘PRIMARY’, ‘MANKATO’, ‘SWG’, 7 )
insert into LOCHIERARCHY (LOCATION,PARENT,SYSTEMID,CHILDREN,SITEID,ORGID, lochierarchyid) values (‘MECSCTR’, ‘MEC’, ‘PRIMARY’, 0 , ‘MANKATO’, ‘SWG’, 17 )
First you need to understand how ancestor and lochierachy works… need to insert many record to create hierachy relationship.
This is more hardcode way… you can also try to create a Objectstructure to work with this kind of relationship. This is more complicated i think.