Yes. The prepare statement can potentially do a lot of work figuring out how to actually perform the SQL statement in the most efficient manner. Even in this simple INSERT example, say Table1 has an index based upon "ip" and Table2 doesn't or is indexed in some other way. The insert for Table1 requires a different set of functionality (also update the index) than for Table2. Using a different Table is a lot more involved than generically inserting different column values. A fancy SELECT statement could have vastly differing execution strategies depending upon exactly what table(s) it is operating upon. Essentially there are limits to what the DB can be "prepared" in advance to handle.

In reply to Re^3: perl dbi, prepare function using place holder by Marshall
in thread perl dbi, prepare function using place holder by leostereo

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.