ostringstream变量不起作用

时间:2014-08-19 17:21:28

标签: c++ mysql

我在函数>

中有以下代码
                 ostringstream loading_csv_query;
                 ostringstream get_last_id_query;
                 in.getline(h1,255);
                 previouscount=this->getlastcount();
                 get_last_id_query << "set @count= "
                                   << previouscount ;
                 string pp=get_last_id_query.str();
                 if(mysql_query(con,get_last_id_query.str().c_str()))
                 loading_csv_query << "LOAD DATA INFILE '" << h1 << "' " 
                               << "INTO TABLE "<< g
                               << "FIELDS  TERMINATED BY ',' "
                               << "ENCLOSED BY '\"' "
                               << "LINES TERMINATED BY '\\n' "
                               << "IGNORE 2 ROWS"
                               <<"(@sno,@var1,line,section,station,system,sub_system,equipment,sub_equipment,failure_time,rectified_time,duration,failure_description,rectification,lmd,origin,attended_by,reported_by,urr,@a1,@a2,@a3)"
                               <<"set id = (@count :=@count+1), failure_date =STR_TO_DATE(@var1, '%c/%e/%Y')";
        string h=loading_csv_query.str();
        query_state=mysql_query(con,loading_csv_query.str().c_str());

h变量总是&#34; &#34;并且不会接受字符串。

0 个答案:

没有答案