开发者

Informix OIC++ : query yields error MI_LIB_USAGE / Argument (client library error) is NULL

Using Informix C++ interface, the first query is fine, but the second yields this error

MI_LIB_USAGE: XIX000:-7520:Argument (client library error) is NULL.

My code

// connection okay and open
ITQuery q开发者_如何转开发uery(conn);  
string qtext;
qtext = "SELECT * FROM transit_kunde_s WHERE erledigt='N'";
okay = query.ExecForIteration(qtext.c_str());
ITRow *row;

while (row = query.NextRow()) {
     // do stuff 

     // now update that row
     qtext = "UPDATE transit_kunde_s SET erledigt='Y' WHERE transitkunde='"+ts+"'";
     code = query.ExecForStatus(qtext.c_str());
     // ERROR
}

Any ideas why?


solution is to use a fresh query object:

ITQuery query_up(conn);
code = query_up.ExecForStatus(qtext.c_str());

EDIT: And if one want transaction enabled one has to use a fresh connection! See [http://stackoverflow.com/questions/5095519/how-to-use-transactions-in-informix-csdk]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜