I don't have the docs in front of me, but read the DBI docs. Basically what you need to do is turn attributes 'raiserror' and 'printerror' off.

Personally, however, I would never do that. Why not test the tables, see if they are there and then remove them. You can get the errors into your programme, but why do you have to do anything with them? If they are about things like attempt to write a duplicate record or such, you can sensibly choose what to ignore and what to take seriously.

A missing table is not an error to necessarilly die for. But it is that sort of behaviour in PHP which keeps many Perl programmers from using it. My in-house PHP hacker searched for several hours the other day to find out why his script wouldn't write teh data it was supposed to... he wasn't trapping any errors and the table was not present... his table creation code had not worked but he did not realise it.

jdtoronto


In reply to Re: Keeping Perl DBI Quiet by jdtoronto
in thread Keeping Perl DBI Quiet by cditty

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.