Hi,

ON DUPLICATE KEY UPDATE is only available with MySQL 4.1.x.

Regards,
  Jocelyn
----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 08, 2003 8:32 AM
Subject: Insert...on duplicate key update


> >Description:
> I have been writing an update program in perl,   and sought to make use of
the
>  insert...update construct described in the insert syntax section of the
manual supplied
>  with the download of mysql-4.0.13-standard. However, upon using the
construct in my code,
>  I receive syntax error messages centered on the 'on duplicate key
update..' section of the
>  statement.
> >How-To-Repeat:
>       here is my statement in a simplified form, given directly to the
database:
>
> mysql> insert into connections (taskID, deadline, user) values
('001',7,'Bob')
>     -> ON DUPLICATE KEY UPDATE deadline=deadline+7, user='Jane';
>
> i even tried removing all but on ecolumn name from the statement, with the
followiign error still resulting:
>
> ERROR 1064: You have an error in your SQL syntax.  Check the manual that
corresponds to your MySQL server version for the right syntax to use near
'ON DUPLICATE KEY UPDATE user='Jane'' at line 2
>
> The column names are correct
> i have noticed that this section no longer exists in the current version
of the manual, but assumed
> it would still be correct given I have been working from the manual
distributed with version I'm
> running. An explaination of where I'm going wrong, or a simple
confirmation of the removal of the
> insert...update construct would be extremely helpful/appreciated.
>
> >Fix:
>
>
> >Submitter-Id: <submitter ID>
> >Originator:
> >Organization:
>   -- 
>    Zoe Scaife - System Support Engineer Intern
>
>   ==================================================================
>      ,-_|\  Sun Services                E-mail : [EMAIL PROTECTED]
>     /     \ Sun Microsystems Australia  Direct : +61 (8) 8414 9320
>     \_,-*_/ Level 7, 41 Currie St       Phone  : +61 (8) 8414 9350
>          v  Adelaide  SA  5000          mobile :  0402 256 628
>    ==================================================================
>   The optimist views the glass as half full,
>   The pessimist sees it as half empty -
>   Engineers know the glass is twice as big as it needs to be :)
>
> >
> >MySQL support: none
> >Synopsis: manual description of insert...update syntax appears to be
incorrect
> >Severity: non-critical
> >Priority: medium
> >Category: mysql
> >Class: doc-bug
> >Release: mysql-4.0.13-standard (Official MySQL-standard binary)
> >Server: ./mysqladmin  Ver 8.40 Distrib 4.0.13, for sun-solaris2.8 on
sparc
> Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
> This software comes with ABSOLUTELY NO WARRANTY. This is free software,
> and you are welcome to modify and redistribute it under the GPL license
>
> Server version 4.0.13-standard
> Protocol version 10
> Connection Localhost via UNIX socket
> UNIX socket /tmp/mysql.sock
> Uptime: 22 hours 31 min 8 sec
>
> Threads: 2  Questions: 470  Slow queries: 0  Opens: 18  Flush tables: 1
Open tables: 5  Queries per second avg: 0.006
> >C compiler:    gcc (GCC) 3.2
> >C++ compiler:  gcc (GCC) 3.2
> >Environment:
>
> System: SunOS kwel 5.8 Generic_108528-14 sun4u sparc SUNW,Ultra-4
> Architecture: sun4
>
> Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gcc
/usr/dist/pkgs/devpro/5.x-sparc/bin/cc
> GCC: Reading specs from
/opt/sfw/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/specs
> gcc version 2.95.3 20010315 (release)
> Compilation info: CC='gcc'  CFLAGS='-O3 -fno-omit-frame-pointer'
CXX='gcc'

CXXFLAGS='-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -
fno-rtti'  LDFLAGS=''  ASFLAGS=''
> LIBC:
> -rw-r--r--   1 root     bin      1768540 May 25  2002 /lib/libc.a
> lrwxrwxrwx   1 root     root          11 Nov 19  2001 /lib/libc.so ->
./libc.so.1
> -rwxr-xr-x   1 root     bin      1146284 May 25  2002 /lib/libc.so.1
> -rw-r--r--   1 root     bin      1768540 May 25  2002 /usr/lib/libc.a
> lrwxrwxrwx   1 root     root          11 Nov 19  2001 /usr/lib/libc.so ->
./libc.so.1
> -rwxr-xr-x   1 root     bin      1146284 May 25  2002 /usr/lib/libc.so.1
> Configure command: ./configure '--prefix=/usr/local/mysql'
'--with-comment=Official MySQL-standard binary'
'--with-extra-charsets=complex' '--with-server-suffix=-standard'
'--enable-thread-safe-client' '--enable-local-infile' '--enable-assembler'
'--with-named-z-libs=no' '--with-named-curses-libs=-lcurses'
'--disable-shared' '--with-innodb' 'CC=gcc'
'CFLAGS=-O3 -fno-omit-frame-pointer'
'CXXFLAGS=-O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -
fno-rtti' 'CXX=gcc'
> Perl: This is perl, version 5.005_03 built for sun4-solaris
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
>
>


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

Reply via email to