The inv_hierarchies and the inv_flat_hierarchies tables store master-sub relationships for investments in CA PPM.
In the inv_hierarchies table you will have records for each immediate relationships.
So you can also use inv_flat_hierarchies. This tables simplifies the record access. You will see Parent ID, Child ID and the Gierarchy Path in that table. In this way, you can run a simple select query and get all the sub projects under a specific investment.
for example:
Suppose there is a program called Program1 whose internal ID is 5000001.
Now run this query and it will show you all the sub-investments under program1 in this hierarchy.
Select child_id from inv_flat_hierarchies where parent_id = 5000001
Hope this was helpful.
Cheers!