more useful options | |
PerlMonks |
Re: How to display all the content of the database?by CountZero (Bishop) |
on Jan 09, 2003 at 21:27 UTC ( [id://225649]=note: print w/replies, xml ) | Need Help?? |
Just a wild thought: why would one like/need to have so many different tables (one for each level)? I would rather have one table which in each record would hold its own ID, its level number (say: section = 1; department = 2; ...), its name and the ID-number of its parent (and any other info you need to store for this entity. Traversing such a structure or selecting would be rather simple with the help of some well chosen SQL-queries: Finding out how deep your organization is, is as simple as finding the maximum of the level numbers. You could store meta-data about the levels (not the individual entities) in a separate table, the ID of which is of course the level number, ... etc. etc. No need to access the meta-data of the database and you can implement it in any type of database and use DBI::DBD in a portable way. Of course if the structure of your organization is much more complex, you can always try to catch it in an XML-structure, which is more flexible but more difficult to use. CountZero "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
In Section
Seekers of Perl Wisdom
|
|