Page 1 of 1

MERGE function/method in MariaDB (SOLVED)

Posted: Wed May 16, 2018 5:19 am
by fraxzi
Hi All,

I'm new to MariaDB. Is there a similar MERGE (update/insert) in MariaDB Class or similar?

Re: MERGE function/method in MariaDB

Posted: Wed May 16, 2018 6:02 am
by Marc Vanzegbroeck
Frances,

Do you mean the update query?
https://dev.mysql.com/doc/refman/8.0/en/update.html

Re: MERGE function/method in MariaDB

Posted: Wed May 16, 2018 6:08 am
by fraxzi
Marc Vanzegbroeck wrote:Frances,

Do you mean the update query?
https://dev.mysql.com/doc/refman/8.0/en/update.html



Hi Marc,

In ADS there is MERGE where it insert a record if not exist then update it if exists.

Re: MERGE function/method in MariaDB

Posted: Wed May 16, 2018 6:31 am
by fraxzi
Hi All,

I think I found it... :)

https://mariadb.com/kb/en/library/insert-on-duplicate-key-update/

I will try this sooner.. :)

Re: MERGE function/method in MariaDB (SOLVED)

Posted: Wed May 16, 2018 7:35 am
by nageswaragunupudi
All this is simpler if you use FWH Maria DB

Code: Select all | Expand


oCn:Insert( <ctable>, <fieldlist>, <aValues>, .T. ) // last param .T.
 

If the last param is .T., this will update in case of duplicate or insert if it is not duplicate.

Re: MERGE function/method in MariaDB (SOLVED)

Posted: Wed May 16, 2018 8:20 am
by fraxzi
nageswaragunupudi wrote:All this is simpler if you use FWH Maria DB

Code: Select all | Expand


oCn:Insert( <ctable>, <fieldlist>, <aValues>, .T. ) // last param .T.
 

If the last param is .T., this will update in case of duplicate or insert if it is not duplicate.



Hi Mr. Rao,

This is much better! :D

Thanks,
Frances