Hello Everyone,
I am trying to connect citect with mysql. the odbc driver is used while connecting both. I have test the connection with the odbc driver it is successful but while send data from citect to mysql database it show the error. I have tried with sql standard, sql express everying works fine data reaches the desired database. I am using "mysql-5.7.19-winx64" version & trying to read data mysql workbench. I am confused please help. thanks in advance
the citect code given below:
FUNCTION Utility_Status_Report();
INT hSql;
INT iSqlResult;
STRING sDate;
STRING sTime;
sDate = Date(10);
sTime = Date(5);
hSql =SQLConnect("DSN=Harshal_1");
IF hSql <> -1 THEN
//Message("SQL Connect","SQL Connection Successful", 48);
SQLBeginTran(hSql);
iSqlResult = SQLSet(hSql,"Insert into US (Datelog,CWF,RWF,SWF,SF,AF,CWP,RWP,SWP,SP,AP,CWST,CWRT,SUPV,CUR,POWER)");
iSqlResult = SQLAppend(hSql," Values ('"+sDate+"','"+RealToStr(RPT_US_CW_F,10,1)+"','"+RealToStr(RPT_US_RW_F,10,1)+"','"+RealToStr(RPT_US_SW_F,10,1)+"','"+RealToStr(RPT_US_S_F,10,1)+"'");
iSqlResult = SQLAppend(hSql,",'"+RealToStr(RPT_US_A_F,10,1)+"','"+RealToStr(RPT_US_C_W_P,10,1)+"','"+RealToStr(RPT_US_RW_P,10,1)+"','"+RealToStr(RPT_US_SW_P,10,1)+"','"+RealToStr(RPT_US_S_P,10,1)+"'");
iSqlResult = SQLAppend(hSql,",'"+RealToStr(RPT_US_A_P,10,1)+"','"+RealToStr(RPT_US_CWST,10,1)+"','"+RealToStr(RPT_US_CWRT,10,1)+"','"+RealToStr(MCC_INC_AVG_VOLT,10,1)+"','"+RealToStr(MCC_INC_AVG_CUR,10,1)+"'");
iSqlResult = SQLAppend(hSql,",'"+RealToStr(MCC_INC_W/1000,10,1)+"')");
//iSqlResult = SQLAppend(hSql,",'"+RealToStr(RPT_US_A_P,8,1)+"','"+RealToStr(RPT_US_CWST,8,1)+"','"+RealToStr(RPT_US_CWRT,8,1)+"','"+IntToStr(RPT_US_V)+"','"+IntToStr(RPT_US_C)+"','"+IntToStr(RPT_US_P)+"'");
iSqlResult = SQLExec(hSql,"");
IF iSqlResult = 0 THEN
//Message("SQL Insert","SQL Insert Successful",48);
SQLCommit(hSQL);
ELSE
Message("SQL Insert US",SQLErrMsg(hSql),48);
END
SQLDisconnect(hSql);
END
END
the error pic this 