Hello.

Perhaps you have forgotten to add col_name=expr to the end of your
query. See:
  http://dev.mysql.com/doc/refman/5.0/en/insert.html



Jonathan Mangin wrote:
> 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
> 


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
       <___/   www.mysql.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to