0
点赞
收藏
分享

微信扫一扫

otl + mysql 查询时映射字段


如果没有映射字段类型,会出现字符型字段无法获取的错误 。

 

如果只映射了字符型字段,则会出现数字型字段为0的问题。

 

因此需要全部映射,

 

string sql="select id,classname,ordernum,bcid,bname from  tbsmall where bcid=:bcid<int>  order by ordernum";

 

otl_stream o;
 o.set_column_type(1,otl_var_int,4);
 o.set_column_type(2,otl_var_char,50);
 o.set_column_type(3,otl_var_int,4);
 o.set_column_type(4,otl_var_int,4);
 o.set_column_type(5,otl_var_char,50);
 o.open(50,sql.c_str(),conn);

举报

相关推荐

0 条评论