Thank you - that's an excellent lead. I'll give the $dbh->selectall_arrayref a shot.

Re: the placeholder - thanks for the catch, but I had been too sloppy in editing the original code. There is indeed a placeholder:

my $sql_region_id = "select distinct k.id from config.object o join config.location l on l.id=o.location join config.location k on k.id=l.region order by k.id desc"; my $sql_statement = "select x.ip, m.modemmacaddress, m.date_time, m.cmtsrxsnr, m.cmtsrxpower, m.modemrxsnr, m.modemrxpower, m.modemtxpower, m.microreflections, m.corrected, m.uncorrectable, a.node, a.addr, a.street, a.city, a.state, a.zip5, k.name, i.ifDescr from config.object o join config.location l on l.id = o.location join config.location k on k.id = l.region and k.id = ? join nemos.arp x on o.id = x.object join modem_hist.mh_day_0 m on m.cmtsid = x.object and m.modemmacaddre +ss = x.mac join cust.equipment e on e.mac = x.mac join cust.addr a on a.acct = e.acct join config.ifdrum i on i.object=o.id and i.ifdrum = x.ifdrum where o.community is not null and i.ifindex > 0 and (m.modemtxpower < -15 or m.modemtxpower > 55) or (m.modemrxsnr < 28) or (m.modemrxpower < -12 or m.modemrxpower > 12) or (m.cmtsrxsnr < 25) or (m.microreflections > 40) "; unless ( $region_cursor = $dbh->prepare( "$sql_region_id" )){ exit 1; } unless ( $region_cursor->execute ) { exit 2; } $region_cursor->bind_columns(\($region_id)); while( $region_cursor->fetch() ){ unless ( $cursor = $dbh->prepare( "$sql_statement" )) { exit 1; } unless ( $cursor->execute($region_id) ) { exit 2; } while( $cursor->fetch() ) { do stuff... } }

In reply to Re^2: Lost connection to MySQL server by spstansbury
in thread Lost connection to MySQL server by spstansbury

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.