Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: perl DBI statement

by cbtshare (Monk)
on Dec 04, 2016 at 12:54 UTC ( [id://1177152]=note: print w/replies, xml ) Need Help??


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

Yes, I have tried that, the issue i run into is DBD::mysql::st execute failed: Duplicate entry '00000510011339735_1015422747869973' for key 'PRIMARY' at /home/rdscopy.pl line 104. DBD::mysql::st execute failed: Duplicate entry '00000510011339735_1015422747869973' for key 'PRIMARY' at /home/rdscopy.pl line 104.
Line 104 is: $sth_insert->execute(@insert) or die $sth_insert->errstr;

Replies are listed 'Best First'.
Re^3: perl DBI statement
by poj (Abbot) on Dec 04, 2016 at 13:32 UTC

    You can't insert a record with the same primary key as an existing record. If the destination table is empty then it looks like the source table does not have the same primary key contraint as the destination table.

    poj
      yes, the destination table is truncated.So the issue is the source table? how would I solve this issue?

        No, the issue is in the destination table. The issue is why does it already have a record with that same primary key?

        What is contained in $feed_table when the prepare select is run and then what is in $feed_table when the prepare insert is run? And what are the statements that assign values to $dbh2 and $dbh3. And what are the create table commands used to create each of those tables? And are you sure that the variable order returned from select * is the same order you specified in the prepare insert statement. And why do you feel that the destination table is truncated, why are you sure of that?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1177152]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-23 23:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found