[Gambas-user] how to manage mysql error in gambas ?

Cristiano Guadagnino criguada at gmail.com
Tue Mar 31 20:15:25 CEST 2020


Hi Marc,
this does not reply your Gambas question, however the problem you face is
usually handled directly in-database by using the MERGE statement.
MySQL does not support MERGE, but it does support something similar: see
https://www.dbrnd.com/2015/08/insert-update-merge-statement-in-mysql/

Hope this helps
Bye
Cris



Il giorno mar 31 mar 2020 alle ore 18:34 Marc Guillaume <alarch at alarch.pw>
ha scritto:

> hi everybody,
>
> I would like to use the mysql error handling when I try to make a mysql
> insert that generates a "Duplacate entry" error in mysql to be able to
> transform the query into an update of one of the table fields. But
> Gambas returns the -1 error whatever the mysql error generated. I can
> parse the mysql error message that is returned, but is there a way to
> retrieve the specific error number from MySQL?
>
> Otherwise I'll try to use a stored procedure.
>
> thanks for your help
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200331/120ccee5/attachment-0001.html>


More information about the User mailing list