Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.

In reply to Re: How to display all the content of the database? by Alex the Serb
in thread How to display all the content of the database? by Alex the Serb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-19 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found