http://qs1969.pair.com?node_id=225740


in reply to How to display all the content of the database?

Thanks everyone, but I somehow think that everything is not so clear yet.

Its not the question of which company it is, the script should work for any company or any catalog of some store or anything else. The large number of data would probably be limited with LIMIT and OFFSET clauses. But, I'm under impression that the most of you are telling me that this could be done with SQL without Perl? I have a version of MySQL which does not support subqueries. The script should work on any DBMS and use common stuff to any DBMS. The script should be generic and work in a way so that if anyone transfers it to store/stores that have different catalogs of different stuff, with different set of tables, it would still work perfectly.

For example, if we have:

section(s_id, ...);
division(d_id, s_id, ...);

the script should give:
sector 7 ... division 1 ... division 2 ... ... ... sector 8 ... division 1 ... ... ... ... ...
Then one day, they decide to add a new type of entity called department (its just a new level of depth for the script, nothing more!)

The script should then give:
sector 7 ... division 1 ... department 1 ... department 2 ... ... ... division 2 ... department 1 ... ... ... ... ... sector 8 ... division 1 ... department 1 ... ... ... ... ... ... ...
Of course some of divisions would not have departments, but that does not matter for the script, the script would display it in the correct way, because its generic. And even if some day someone add a new type of entity it would still work correctly :)

I know this is huge problem and I'm not asking you to do it, I'm just asking the small example of it with Perl using DBI, or code example of some idea or at least point me to the right direction :)

Thanks.