Two possible approaches to avoid loading all the data at once. This may not matter to you in this case, but with more data, it could be an issue.

1)Three db handles and matching statement handles: $dbh1,$sth1; $dbh2,$sth2; $dbh3,$sth3. Set each up using the same syntax. Then walk through (and ignore) the first 100 rows for $sth2. Do the same for the first 200 rows for $sth3. (There's probably a more clever way to advance handles 2 and 3 to the appropriate position.) Then in your loop, grab a value from each $sth in turn and build your table cells: 1,101,201; 2,102,202, etc.

2)Table-in-a-cell. Make your main table have three columns but only one row. In each of the three cells of that table (which become your columns) build a second, inner table consisting of a single column and 100 rows (resulting in three inner tables: one for each column). Then build the display with an outer loop (one for each column cell) that sets up the first cell and the inner table and then goes into an inner loop that reads the data a row at a time. The first time through the inner loop it spits out items 1-100 one item per row into the table in column one. After the inner loop, close the first cell. Then on the second time through the outer loop, the inner loop spits out items 101-200 into the next table in column two. etc.
Update: Or skip the inner table and just use <BR> tags to separate each line in the column as synapse0 (who read your question more closely) suggests. Note that, as you have defined the problem (each column is one long data cell), there is absolutely no need to read in all the data at once.

HTH


In reply to Re: DBI output in 3 columns by dvergin
in thread DBI output in 3 columns by Donzo

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.