in reply to Re^6: perl DBI statement
in thread perl DBI statement

Looks like you are connecting dbh2 and dbh3 to the same database

my $dbh2 = DBI->connect( $from_feed_dsn, $from_feed_user, $from_feed +_pass, { RaiseError => 1, PrintError => 1 }) or die; my $dbh3 = DBI->connect( $from_feed_dsn, $from_feed_user, $from_feed +_pass, {RaiseError => 1, PrintError => 1 }) or die ;

Shouldn't that be

my $dbh3 = DBI->connect( $destination_dsn, $destination_user, $destina +tion_pass, {RaiseError => 1, PrintError => 1 }) or die;

Maybe a copy/paste and forgot to edit error !

poj

Replies are listed 'Best First'.
Re^8: perl DBI statement
by cbtshare (Monk) on Dec 04, 2016 at 23:28 UTC
    YES!!!...you are so correct, I apologize for wasting everybody's time, I overlooked that, cant tell how many times I reviewed those lines and saw what I wanted to put there and not what is .

      You are fortunate that the Primary Key constraint stopped your error from corrupting the production database. I would suggest you ask your DBA to create a user with SELECT only privileges and use that for $from_feed_user instead of root.

      poj