<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;"><div>Hello fellows,</div><div><br></div><div>I’m implementing a project that uses mysql-otp for some of its components.</div><div>At one point, I have to do an INSERT statement with an ON DUPLICATE KEY clause.</div><div>What happens is that on the ON DUPLICATE KEY statement, I only want to use the last parameter of the parameter list I provide in the query() call.</div><div>I can’t find a way to name parameters in the parametrized query.  Was wondering if anyone had similar experience before.</div><div><br></div><div>Below follows a generic example of what I’m trying to achieve.</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">                             </span>ok = mysql_poolboy:query(?DB_POOL_NAME, </div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>"INSERT INTO `X` (`a`, `b`, `c`, `d`, `e`) VALUES (?, ?, 1, 0, ?) </div><div><span class="Apple-tab-span" style="white-space:pre">                                 </span> ON DUPLICATE KEY </div><div><span class="Apple-tab-span" style="white-space:pre">                                      </span> UPDATE c = c + 1, d = 0, e = ?", </div><div><span class="Apple-tab-span" style="white-space:pre">                                 </span>[A, B, C]);</div></div><div><br></div><div>I want e = C, in the duplicate key statement. Right now, as it is, I’m not sure of what the behaviour will be, but e will probably be e = A.</div><div><br></div><div>Cheers,</div><div><div id=""><div style="color: rgb(0, 0, 0);">-- </div><div><p style="color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); margin: 0cm 0cm 0.0001pt; font-size: 11pt;"><font color="#1f497d"><b>Fábio S.</b></font></p><p style="color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); margin: 0cm 0cm 0.0001pt; font-size: 11pt;"><font color="#1f497d"><b>Team Rocket</b></font></p></div></div></div></body></html>