<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Marc,</div><div class="gmail_default" style="font-size:small">this does not reply your Gambas question, however the problem you face is usually handled directly in-database by using the MERGE statement.</div><div class="gmail_default" style="font-size:small">MySQL does not support MERGE, but it does support something similar: seeĀ <a href="https://www.dbrnd.com/2015/08/insert-update-merge-statement-in-mysql/">https://www.dbrnd.com/2015/08/insert-update-merge-statement-in-mysql/</a></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Hope thisĀ helps</div><div class="gmail_default" style="font-size:small">Bye</div><div class="gmail_default" style="font-size:small">Cris</div><div class="gmail_default" style="font-size:small"><br></div>
              <div><br></div>
              </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno mar 31 mar 2020 alle ore 18:34 Marc Guillaume <<a href="mailto:alarch@alarch.pw">alarch@alarch.pw</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">hi everybody,<br>
<br>
I would like to use the mysql error handling when I try to make a mysql<br>
insert that generates a "Duplacate entry" error in mysql to be able to<br>
transform the query into an update of one of the table fields. But<br>
Gambas returns the -1 error whatever the mysql error generated. I can<br>
parse the mysql error message that is returned, but is there a way to<br>
retrieve the specific error number from MySQL? <br>
<br>
Otherwise I'll try to use a stored procedure. <br>
<br>
thanks for your help<br>
<br>
----[ <a href="http://gambaswiki.org/wiki/doc/netiquette" rel="noreferrer" target="_blank">http://gambaswiki.org/wiki/doc/netiquette</a> ]----<br>
</blockquote></div>