How to read boolean from Database?
Read the article https://www.mql5.com/en/articles/7463
Use type casting after reading
- www.mql5.com
Read the article https://www.mql5.com/en/articles/7463
Use type casting after reading
Thanks for the reply!
Regarding the article, that's actually the one I've been using to learn how to use the Database system. Problem is, a ctrl+f gave no relevant results about using "bool" with Database (and the same happened with the Forum and Google) :T
Regarding type casting, I think I got it:
//instead DatabaseColumnInteger(request, column++, opList[aaa].isFake); //using int isFake; DatabaseColumnInteger(request, column++, isFake); opList[aaa].isFake = bool(isFake);
No more errors messages. Thanks! :)
Hi,
I've a system using SQL database. Initially I used a 3rd party API but now I'm transfering to MT5's own Database system.
I'm working with some lines where I'm suppose to read some boolean data from a table and I noticed there is no specific "DatabaseColumn" function for boolean. I assumed it would be the DatabaseColumnInteger (since bool is actually 0 ou 1), but I got an error: "parameter conversion not allowed". I did some research here in the forum and in the docs and couldn't find anything about this.
So which function I'm supposed to use when reading a boolean value from Database?