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

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
elugovoy:
You explained very clearly.Because,I use a lot of extraneous data for my index ,so the connections become very large ,once more than 32 ,MT4 will point out “error” and show nothing in the index windows.
Hello,
Yes the max number of connections is 32
Are you trying to use your MQL program based on MQLMySQL.dll on more than 32 charts concurrently?
Or you just forgot to close the connection in your program?
To change max connection from 32 to another you have to rebuild MQLMySQL.DLL. The sources are attached to the article, you have to:
1. Unpack sources from "MQLMySQL DLL Project MSVS-2010.zip"
2. Load the project into MS Visual Studio 2010 or higher
3. Open file "MQLMySQL.h"
4. Find string:
and replace value 32 with 64 or whatever you want
5. Rebuild the project
6. Replace an old DLL in your Metatrader data folder with new compiled.
Regards,
Eugene
First all, thanks for the lib, is by far the better solution out there and the most documented.
I was wondering if there is any way to get the affected rows after an update statement, in order to execute an insert if updated records is 0 (the update succeed, just doesn't update any records because the "where" filter conditions).
I don't want to use a "insert on duplicate key update" because 99.9% of the time the update statement will effectively update 1 record (already exists), and therefore there's no need to execute the insert. I guess there's a performance impact trying to insert always with no need.
Thanks in advance!
First all, thanks for the lib, is by far the better solution out there and the most documented.
I was wondering if there is any way to get the affected rows after an update statement, in order to execute an insert if updated records is 0 (the update succeed, just doesn't update any records because the "where" filter conditions).
I don't want to use a "insert on duplicate key update" because 99.9% of the time the update statement will effectively update 1 record (already exists), and therefore there's no need to execute the insert. I guess there's a performance impact trying to insert always with no need.
Thanks in advance!
Hello dear friend,
If you have MSVC 2010 you can download the sources of MQLMySQL.DLL and add the function you need; the MySQL C++ API has such function (http://dev.mysql.com/doc/refman/5.0/en/mysql-affected-rows.html)
Or I can do it for you, but right now I have no time for this, can do on weekend (7-8 March, 2015), is it allright with you?
Regards,
Eugene
Hello dear friend,
If you have MSVC 2010 you can download the sources of MQLMySQL.DLL and add the function you need; the MySQL C++ API has such function (http://dev.mysql.com/doc/refman/5.0/en/mysql-affected-rows.html)
Or I can do it for you, but right now I have no time for this, can do on weekend (7-8 March, 2015), is it allright with you?
Regards,
Eugene
Of course it works for me !!!
Thank you very much.
Josep M.
Hi Eugeniy,
did you have the chance to have a look at the "affected rows" feature ?
Greetings,
Josep M.
Hi Eugeniy,
did you have the chance to have a look at the "affected rows" feature ?
Greetings,
Josep M.
Hello Josep,
I've replied in private message.
Anyway I'm posting here the v2.2. Tested on MT4. If you have troubles with MT5 (x32/x64) just let me know.
Happy working!
Great work, Thank you very much Eugeniy .
Your codes help me so much, i can save so much time. I tried to do INSERT, SELECT, UPDATE and DELETE query successfully. If i am not wrong, the "Cursor" is needed only for SELECT query only ??
= pedma
Great work, Thank you very much Eugeniy .
Your codes help me so much, i can save so much time. I tried to do INSERT, SELECT, UPDATE and DELETE query successfully. If i am not wrong, the "Cursor" is needed only for SELECT query only ??
= pedma
Exactly man!
The cursors used only for data selection because we have to receive data from db into MQL variable, not just to send the sql command to database.
I'm glad that my solution helps you.
Good luck,
Eugene
Hi Eugene,
I was just wondering if you still do paid development projects as I am looking to create a remote trade copier which is integrated into an EA that I will be selling?
I looked on Upwork and you don't appear to have completed any freelancer projects recently.
I had a go myself using the library you created, but it didn't turn out too well. Though I'm sure it would be easy for someone with your programming ability!
Thanks in advance,
James
Hi Eugene,
I was just wondering if you still do paid development projects as I am looking to create a remote trade copier which is integrated into an EA that I will be selling?
I looked on Upwork and you don't appear to have completed any freelancer projects recently.
I had a go myself using the library you created, but it didn't turn out too well. Though I'm sure it would be easy for someone with your programming ability!
Thanks in advance,
James
Hello James,
I'm working at Upwork only on one big project currently. So, have no much free time nowadays. What's the problem you have with libs? How can I help you?