I am trying to insert some data from MT4 via libmysql.dll using an mysql wrapper. I have successfully managed to create and select a database, create a table, and even retrieve entries from a table (which were entered into a table from mysql workbench). I am now having trouble populating a table with data from mt4.
The problem: running the below insert query returns error 1064 at mt4 terminal.
query = StringConcatenate ("insert into ",tablename," (`MQLTime`, `RTime`, `Open`, `High`, `Low`, `Close`, `Volume`) values ('" ,time, "','" ,RTIME, "'," ,open, "," ,high, "," ,low, "," ,close, "," ,volume, ");" );
The table ( and column datatypes) are generated as below:
query = StringConcatenate("CREATE TABLE ",dbName,".",tablename,"
(MQLTime CHAR NOT NULL, RTime CHAR NULL, Open DOUBLE NULL,
High DOUBLE NULL, Low DOUBLE NULL, Close DOUBLE NULL, Volume BIGINT NULL,
PRIMARY KEY (MQLTime));");
The insert query as printed to the mt4 terminal indicates the error lies in VALUES part of the query ("??")
insert into EURUSD_M1 (`MQLTime`, `RTime`, `Open`, `High`,
`Low`, `Close`, `Volume`) values ??('2014.07.30 13:00:00','2014.07.30 13:00:00',1.34018,1.34027,1.34015,1.34027,79);
When this print statement is entered into workbench (without "??"), the values are successfully entered into the appropriate columns.
I guess there is an issue with datatypes somewhere but I can't seem to figure out what it is. Any suggestions would be great. Thank you