Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

How to get the list of all the tables extended from base table and their unique columns as well?

Ajay37
Tera Contributor

Hi,

For suppose if I have a table A extended from base table cmdb_ci which can be further extensible. Now I extended table B from table A and in the same way table C from table B. Table C is someway related to base table cmdb_ci and it has all the columns of cmdb table. Now I am trying to write a script, which get all the tables somehow related to cmdb_ci. Like in this example, I need to get list like A, B, C even B and C are not direcly extended from cmdb_ci, I want them in list.

And also, I want to get the unique columns list in A, B, C which shouldn't extended from parent table. Could anybody has an idea on achieving this?

Thanks

6 REPLIES 6

Anurag Tripathi
Mega Patron

Hi,

You can get the column list form dictionary table. Not how they are related though, that would be a bit of manual exercise looking at schemas etc.

-Anurag

-Anurag

Hi @Anurag Tripathi ,

Thank you. I have around 100 tables extended from cmdb_ci, and among these some are extensible don't know how many tables got extended from these. So, manually it can't be possible I think.

Hmm yea, if you know the tables then you can extract the field list on each of them individually.

 

-Anurag

ersureshbe
Giga Sage

Hi, 

Please find below screenshot to get the results. You can use encoded query and get the result using script.

find_real_file.png

Please mark as correct answer if it helped.

Regards,

Suresh.

Regards,
Suresh.