Thanks, talexb, Marshall, and LanX!

I now have the script concatenating as large a query string as needed by repeating parts from template strings. Then it pulls everything in from the database through a single prepare() and execute() pair. One of the hard parts was knowing to push the query bind values into two lists to be passed to DBI's execute() and along the way another hard part was getting visible error messages even with the help of the CGI::Carp module.

Two bindvalue lists are often needed because when the final SQL query sometimes starts with a WITH clause, that has to be prepended to the query which means in turn that the bind values have to be at the start. So I use a separate list for the the normal bind values. Both get pushed and sometimes several tables are used at the same time so the push has to take that into account by repeating the same value: push(@bindvalues, ($value) x 3); then the two lists of bind values are combined for the execute() statements.

The template which the Perl script uses to assemble the query is big on its own.

Anyway, I now see a way forward with rest of the Perl script.


In reply to Re^2: Applying logical operators in either complex SQL xor hashes? by mldvx4
in thread Applying logical operators in either complex SQL xor hashes? by mldvx4

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.