I'm trying to change a couple of replace statements to insert...on duplicate key update (using Perl/DBI).
foreach my $key (keys %e_items) { my $sql = "insert table1 (id, date, time, uid, type, seq, value) values (?, ?, ?, ?, ?, ?, ?) on duplicate key update"; my $sth = $dbh->prepare($sql); $sth->execute($e_items{$key}->[0], $date, $e_items{$key}->[3], $uid, $e_items{$key}->[1], $e_items{$key}->[2], $e_items{$key}->[4]) || die $sth->errstr; } The manual says more is needed at the end of my sql, but I'm not sure of the syntax. (Looks to me like all required info is present ;) id is primary key and the only unique index. Thanks, Jon -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]