in reply to Re^4: Help with MySQL SELECT into multidimensional array
in thread Help with MySQL SELECT into multidimensional array

I suggest reading the SQL book that I recommended in another part of this thread. It will cover "views". Your application is "read only" so something like that is completely appropriate.

I am no SQL guru, but SQL has several types of table joins where 2 or more tables can be combined into a single "view" which is like a temporary table with the columns of both tables, but read only. On all tricky SQL questions, I defer to wiser Monks than myself.

However, if you can do the SQL, it can make the Perl code easier because you could just get all the results at once.

There is sometimes a tradeoff between Perl voodoo and SQL voodoo. I had one SQL query that I worked on very hard and it worked, but it took 15 minutes. Then I "simplified it" into 1,500 SQL queries and it took only 15 seconds. But I used some serious "Perl-kung-foo" on it!

From what I understand so far, your app is not performance or memory limited. Find some combination of stuff that works for you! Any of the SQL or Perl code that we've discussed so far will be just fine.

  • Comment on Re^5: Help with MySQL SELECT into multidimensional array

Replies are listed 'Best First'.
Re^6: Help with MySQL SELECT into multidimensional array
by btongeorge (Initiate) on Dec 05, 2011 at 18:09 UTC

    I did some more reading around this, my SQL-fu is way more advanced than my Perl-fu, so I went about it with views, which worked great. Now I have a very simple query which outputs everything that I need, literally as simple as:

    SELECT * from view;

    So now my quest becomes to work out how to spit out an HTML table from my Perl array.

    This is a great step forwards on my path to enlightenment, and I thank everyone for their help so far!

      This is GREAT! My SQL-fu is mediocre. But with the DBI there is often a trade-off between SQL-fu and Perl-fu! I'm glad that you are on your way!

      I've got a DB project underway and may need some help with views. But that is another subject. If you need help with HTML, start a new thread independent of the DB stuff.

      Glad that the Monks could help you!