How to access the database from MQL4 , ORACL , MSSQL, MySQL - page 6

 

it's all working and the base is fluffing up! :)

Good luck.

 
TheVilkas писал(а) >>

it's all working and the base is fluffing up! :)

Good luck.

Score !!!

Really working example.

Thanks

 

HOORAY! My database also worked fine through libmysql.dll. I don't understand why the result is returned with hieroglyphs in the beginning and then the right information. Reworked the above code.

Request: "SELECT concat(';',concat_ws(';',date,title,impact)) FROM calendar WHERE (date between ADDDATE( NOW( ), INTERVAL -4 DAY ) AND ADDDATE( NOW( ), INTERVAL +2 DAY ) AND (currency='"+symb1+"' XOR currency='"+symb2+"') ORDER BY date"

Code:

 for (int i=0; i< numOfRows; i++) { 
      row = mysql_fetch_row( result); 
      //add_news(row); 
   
   int begin = StringFind( row, DELIM)+1; 
   int end = StringFind( row, DELIM, begin);   
      ArrayResize( News_Array, i+1);
      News_Array[ i,0] = StringSubstr( row, begin, end- begin);  // fills datetime data in compatible format
         begin = end+1; 
         end = StringFind( row, DELIM, begin); 
      News_Array[ i,1] = StringSubstr( row, begin, end- begin);   // fills description data
         begin = end+1; 
         end = StringFind( row, DELIM, begin);       
      News_Array[ i,2] = StringSubstr( row, begin, end- begin);  // fills rating data
      if (StringSubstr( row, begin, end- begin) == "High") Event_Rating_No = "3";
      if (StringSubstr( row, begin, end- begin) == "Medium") Event_Rating_No = "2";
      if (StringSubstr( row, begin, end- begin) == "Low") Event_Rating_No = "1";   
      
         begin = end+1; 
         end = StringFind( row, DELIM, begin);      
      
      News_Array[ i,3] = Event_Rating_No;  // number equivalent for ratings
      News_Array[ i,4] = "0";  // used for prevents repetition of alerts
                
        } 


Good luck everyone!

 
GarF1eld >> :

BTRVODKAex

For this purpose an intermediate dll in c++\cli is written. You can't call managed code from mql directly.



Why can't I use C#? And where can I find literature on writing a dll in C++ for MT4?

 
BTRVODKAex >> :

Why can't I use C#? And where can I find literature about writing dll in C++ for MT4?

Answering my own question: "It interferes with marshalling when calling functions" :)

>> went to learn C++.

 

Hello Gentlemen, already asked a question in a parallel thread, but I'll probably repeat it...

MySQL restricts the maximum number of purely columns in a table, to be more precise, the maximum possible number of columns is 1000, does anyone know how this restriction can be removed and is it even possible? If not, what database allows you to create tables with more than 3000 columns?

 
toxa.forex >> :

Hello Gentlemen, already asked a question in a parallel thread, but I'll probably repeat it...

MySQL restricts the maximum number of purely columns in a table, to be more precise, the maximum possible number of columns is 1000, does anyone know how this restriction can be removed and is it even possible? If not, what database allows you to create tables with more than 3000 columns?

Oracle

 
HIDDEN >> :

Oracle

HIDDEN, thanks for the reply, but could you be a little more specific, which Oracle are you referring to? Oracle 9i has the same limitation, max 1000 columns per table...

 
toxa.forex >> :

HIDDEN, thanks for the reply, but could you be a little more specific, which Oracle are you referring to? Oracle 9i has the same limitation, max 1000 columns in a table...

And the later versions.

I haven't worked with Oracle much myself. In general, the idea is spinning around in my head that if you need 3000 columns, then there's something you haven't thought about.... You should break down the information into tables and optimise your queries. You can then generate anything from the database.

Why pour the whole bottle into a thimble, I don't understand.


Explain your goals and objectives, maybe you don't need a database at all.

 
HIDDEN >> :

And the later versions.

I've hardly ever worked with Oracle myself. In general, I'm thinking that if you need 3000 columns, it's something you haven't thought of -.... You should break down the information by tables, optimise your queries. You can generate anything you like from the database.

Why pour the whole bottle into a thimble, I don't understand.


Explain your goals and objectives, maybe you do not need a database at all.

I didn't find out about later versions of Oracle, but I suspect that the restrictions on the number of columns are still in place...

Yes, splitting information into tables is certainly possible, but it's the least desirable solution, as it will significantly increase query processing time due to increased calls to the database... Optimization of queries won't help you, whatever NF you want to reduce it to...

And we are talking about a neural network, using a database is really not necessary here, but in my opinion, it is the best option for storing more than 3000 parameters...

Reason: