Discussion of article "How to Access the MySQL Database from MQL5 (MQL4)" - page 10

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all.
I've rebuilt DLLs and MQL libraries (of MQLMySQL) to support unicode, now reviewing all sources and will share on GitHub very soon.
Also I'm testing now MQLAdoDB project to work with different databases (MS SQL, Oracle, PostgreSQL, MS Access, etc) from MQL using AdoDB & OLEDB.
This project also would be available soon on GitHub, and of course it would be free.
Best regards,
Eugene
Codepage UTF-8 is supported now.
<Deleted>
Happy New Year & good luck in development!
Eugene
Codepage UTF-8 is supported now.
<Deleted>
Happy New Year & good luck in development!
Eugene
Hi Eugeniy, thank you so much for your contribution. It´s very usefull and really works!
Eugeniy Lugovoy:
Codepage UTF-8 is supported now.
<Deleted>
Happy New Year & good luck in development!
Eugene
Hi, wow thanks for all of this, there's a problem with my notifications so I've only just seen that you did this several months later.
Thanks very much, great work.
Peter
Hi @Eugeniy Lugovoy and thanks for your hard work!
In the current version of your implementation, is there a way to retrieve the "LAST_INSERT_ID" after an INSERT operation (in a table with an AUTO_INCREMENT column)?
Thanks in advance and have a nice day :)Hi @Eugeniy Lugovoy and thanks for your hard work!
In the current version of your implementation, is there a way to retrieve the "LAST_INSERT_ID" after an INSERT operation (in a table with an AUTO_INCREMENT column)?
Thanks in advance and have a nice day :)Hi arsenico42, you can try to make insert in one query and then select LAST_INSERT_ID in another one, but I cannot recommend this way, but I cannot recommend this way because LAST_INSERT_ID is function which returning global database variable, and another one insert (from another user, running concurrently) between your original insert and selection of LAST_INSERT_ID can affect LAST_INSERT_ID value.
This is not depended on library, it's how mysql/mariadb works.
But, I can advice you to create a function on database side to insert required values, select LAST_INSERT_ID and return this ID as function value. it might looks like:
And in MQL you have to open cursor for query:
qry="SELECT import_funds_add('bonuses.csv','c:\\broker imports\\XXX-FX','NEW','No errors') as last_id";
then get value as from usual cursor and close cursor.
So, instead of using those commands separately in MQL you can just combine them on DB side into function.
it's just an example from live system.
Hello elugovoy
Awesome article and great libraries.
I'm trying to use your examples under MT5 but I'm getting this error:
2014.12.15 15:44:16.387 MySQL-001 'C:\Users\....\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\libraries\MQLMySQL.dll' is not 64-bit version
Are you running MT5 under 32-bit env?
Could you pleas help me with it?
Thanks very much!
Carmine Marrone.
Hello Carmine, you can download x64 version from sources on github.
https://github.com/elugovoy/MQLMySQL-Project/tree/master/MQLMySQL/x64/Release
Hey @Eugeniy Lugovoy, first of all thanks for all the contribution to the community
I'm stucked here:
"Cannot load 'C:\Users\Admin\AppData\Roaming\MetaQuotes\Tester\D0E8209F77C8CF37AD8BF550E51FF075\Agent-127.0.0.1-3000\MQL5\libraries\MQLMySQL.dll'" [126]
Hey @Eugeniy Lugovoy, first of all thanks for all the contribution to the community
I'm stucked here:
"Cannot load 'C:\Users\Admin\AppData\Roaming\MetaQuotes\Tester\D0E8209F77C8CF37AD8BF550E51FF075\Agent-127.0.0.1-3000\MQL5\libraries\MQLMySQL.dll'" [126]
Make sure you have MQLMySQL.dll & MQLMySQL.def files located in your folder "C:\Users\Admin\AppData\Roaming\MetaQuotes\Tester\D0E8209F77C8CF37AD8BF550E51FF075\Agent-127.0.0.1-3000\MQL5\libraries\"
As you can see if you are running MQL programs in Tester mode, the path to libs would be different (because of UAC)