Skip to Main Content

Cloud Platform

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connection error while connecting mysql with schneider citect

3577944Oct 31 2017 — edited Oct 31 2017

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 error.png

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 28 2017
Added on Oct 31 2017
0 comments
363 views