[Zope] Error, _mysql_exceptions. 'ON DUPLICATE KEY
Kevin Carlson
khcarlso@bellsouth.net
Tue, 01 Jul 2003 11:31:21 -0400
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body>
This is a mysql error message that has nothing to do with zope. I
don't believe that mysql supports the 'ON DUPLICATE KEY' syntax...<br>
<br>
Wayne Connolly wrote:<br>
<blockquote type="cite" cite="mid004301c33f12$69bf93f0$c9698690@XP">
<meta http-equiv="Content-Type" content="text/html; ">
<meta content="MSHTML 6.00.2600.0" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">Hi, i have been playing round with
this insert/update script on zope/mysql and keep recieving the
following error...any idea's on how to get rid of this would be muchly
appreciated?</font></div>
<div><font face="Arial" size="2"> </font></div>
<div>
<div><font face="Arial" size="2"><font face="Arial" size="2">--------------------------------------------------------------------</font></font></div>
</div>
<div><strong>Error, <em>_mysql_exceptions.ProgrammingError</em>:</strong>
(1064, "You have an error in your SQL syntax near 'ON DUPLICATE KEY
update charts set \n plays=plays + 1\n\twhere title='wayne'' at line
14") </div>
<div><font face="Arial" size="2">--------------------------------------------------------------------</font></div>
<div> </div>
<div><font face="Arial" size="2">the ZSQL used is below</font></div>
<div>
<div> </div>
<div><font face="Arial" size="2">--------------------------------------------------------------------</font></div>
</div>
<div><font face="Arial" size="2">insert into charts<br>
(title,<br>
artist,<br>
genre,<br>
album,<br>
plays)<br>
VALUES (<!--#sqlvar title type=string --> ,<br>
<!--#sqlvar artist type=string --> ,<br>
<!--#sqlvar genre type=string --> ,<br>
<!--#sqlvar album type=string --> ,<br>
plays=1<br>
)</font></div>
<div> </div>
<div><font face="Arial" size="2">ON DUPLICATE KEY</font></div>
<div> </div>
<div><font face="Arial" size="2">update charts set <br>
plays=plays + 1<br>
where title=<dtml-sqlvar title type=nb> and
artist=<dtml-sqlvar artist type=nb></font></div>
</blockquote>
</body>
</html>