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

 
Ingvar Engelbrecht:

Excellent!

Using MQL5 to generate data for MQL4.

Everything worked beautifully except that I had to remove the single quotes around tablename on the query command 

Query = "SELECT Symbol,Composite,Pattern FROM summarytable";

works ok

Yes, it's possible to use without quotation if you do not plan to name tables with upper/lower case (mysql is case sensitive) and special symbols. BTW, it's not single quote symbol "'", but it's "`"

So you query also could be: Query = "SELECT `Symbol`,`Composite`,`Pattern` FROM `summarytable`"; 

if you want to name columns Symbol, but not symbol or SYMBOL

 

Hi Eugeniy, 

Thank for your module, very helpful. Could you help to add function to get Field Name? or how I could add it in VC++? 

 
Hello

I have a question.
(* I am translating texts using translation software because I am a Japanese person, so I think it is strange English but please forgive me)

Looking at the article here I am coding Mysql's connection.
You can extract 1 Byte characters with SELECT, but multibyte characters garbled. I changed the character code setting of Mysql side and script side, but it can not be garbled. What is the cause?

Best, Regards.
 
Freemans Core:
Yes, this is known problem, because basically ASCII encoding was used. Now I'm working on UTF encoding support to fix this problem.
 
Eugeniy Lugovoy:
Yes, this is known problem, because basically ASCII encoding was used. Now I'm working on UTF encoding support to fix this problem.

Thank you for your reply. Again, multibyte non-compliant (ASCII) was specification. I would like to think of another way Thank you. Best regards.
 

This is working for me very well..

Can anyone help me insert data by calling a stored procedure?

What are the correct methods.. Other SQLConnection usages define parameters as such:

command.Parameters.Add("@ID", SqlDbType.Int); 
command.Parameters["@ID"].Value = customerID;

 Thanks in advance.

 

Tom 

 
tommylux:

This is working for me very well..

Can anyone help me insert data by calling a stored procedure?

What are the correct methods.. Other SQLConnection usages define parameters as such:

command.Parameters.Add("@ID", SqlDbType.Int); 
command.Parameters["@ID"].Value = customerID;

 Thanks in advance.

 

Tom 

This can be done just using something like this: MySqlExecute(DB, "call YourProc("+(string)customerID+")")

Binding variables is not supported 

 
Excellent work, Евгений, I have couple of EAs, which use your MySQL connector library, some of them are for MT4, some for MT5 (I had hard time to rewrite the code from MQL4 to MQL5, but now everything works perfectly).
The MySQL server is very busy, EAs selects and inserts couple of thousands of records each day (mostly prices and orders data) - I have not restarted trading terminals or the MySQL server for more than 2 weeks - no noticeable performance degradation or memory leaks, they work suspiciously stable.
Keep the good job!
 

I have noticed that having query string longer than 32kB crashes the terminal.
Is it possible to increase the length of executed query string, in my project I have to build dynamic query string with lots of UNION ALL?

I am not sure how can I fix this: MySqlCursorOpen(DB,sql_query);

 
Budyoni Damyanov:

I have noticed that having query string longer than 32kB crashes the terminal.
Is it possible to increase the length of executed query string, in my project I have to build dynamic query string with lots of UNION ALL?

I am not sure how can I fix this: MySqlCursorOpen(DB,sql_query);


Hi, i wonder, can you help me with error libmysql.dll cannot loaded or something.
Why I get this message? although I already put the dll file to MQL4/Libraries/libmysql.dll.

What is the cause? because what i can see is the file is imported, and nothing else but it cannot loaded, even i already checked the checkbox. Can you help me with this problem? Because I can't found it why it happened.


FYI: I'm using Windows 10 x64 and Metatrader4 from Exness.

Thank you.