Discussion of article "SQLite: Native handling of SQL databases in MQL5" - page 3

 
GEORGI ANIKIN:

Hello!

I tried to create a connection to the database in the indicator, but for some reason it didn't work.

Why is it not written anywhere, in which programmes can I use databases?

What error is returned?

 
Rashid Umarov:

What kind of error is it returning?

I already showed a screenshot of the error in my post.

It doesn't find such a function.

Here are the errors:

This is me trying to compile the indicator. I should try it in Expert Advisor and Service.


In fact, you could write in which MQL5 programmes you can use databases. It would be very convenient to use them in the indicator as well.

 
GEORGI ANIKIN:

I already showed a screenshot of the error in the post.

It does not find such a function.

Here are the errors:

This is me trying to compile the indicator. I should try it in Expert Advisor and Service.


In fact, you could write in which MQL5 programmes you can use databases. It would be very convenient to use them in the indicator as well.

What build of the programme?
 
MetaQuotes:
What build of the programme?

Version 5.00, build 2361

 
GEORGI ANIKIN:

I already showed a screenshot of the error in the post.

This is not an error. The error is called via GetLastError

 
Rashid Umarov:

This is not an error. The error is called via GetLastError

I wrote that the error occurred at the compilation stage.

 
GEORGI ANIKIN:

I wrote that the error occurred at the compilation stage.

Yeah, I didn't notice.

 
Is the description of DatabasePrepare queries only in SQLite documentation? There will be no MQL5 documentation?
 
Документация по MQL5: Работа с базами данных / DatabaseReset
Документация по MQL5: Работа с базами данных / DatabaseReset
  • www.mql5.com
//| Script program start function                                    | "PATH           TEXT            ," "SPREAD         INT             ," //| Возвращает спецификацию символа в виде JSON                      | //| Формирует отступ из пробелов                                     |...
 

From the article, though with difficulty, I understand this example

//--- create a query and get a handle on it
   int request=DatabasePrepare(db, "SELECT * FROM COMPANY WHERE SALARY>15000");
   if(request==INVALID_HANDLE)
     {
      Print("DB: ", filename, " request failed with code ", GetLastError());
      DatabaseClose(db);
      return;
     }

This query selects records with a value greater than 15000 from the database. Another example there was to select the sum... But I, for example, need to select the least/most value from the database. Or the sum of values greater than/less than zero. I think there is such a possibility, but there is not enough information in the form of MQL5 documentation. Pulling from examples is difficult for me. But if I don't have it... if necessary, I will try to figure it out.