You have been told repeatedly not to use IGNORE in your prepare statement. Why do you keep doing that? I am curious about that point.

"My insert statement for staging would be below:"

my $ext_insert = $dbh3->prepare("INSERT IGNORE INTO $feed_table_ext (id_code, item_name, item_value, item_data) VALUES (?, ?, ?, ?)") or die $dbh3->errstr;

Update:
It is difficult for me to understand your objective, but perhaps something close to this is what you mean?
====== following your code ===== use Data::Dumper; #get Id_Codes based on entry time # my $feed_table_idcode = $dbh2->prepare("SELECT id_code FROM $feed_table WHERE entry_time >= ?"); #get all columns for each id_code in another table + my $feed_table_ext_results = $dbh2->prepare("SELECT * FROM $feed_table_ext WHERE id_code = ?"); $feed_table_idcode->execute($time); while (my @row = $feed_table_idcode->fetchrow_array() ) { my $id_code = $row[0]; $feed_table_ext_results->execute($id_code); print Dumper $feed_table_ext_results,"\n"; }
Since these tables are both in the same DB, I think that some type of SQL JOIN will get the job done. Without a test DB, I won't attempt it, but that appears plausible to me.

In reply to Re: Perl DBI execute statement by Marshall
in thread Perl DBI execute statement by cbtshare

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.