Hi, I have some questions for use otl and mysql.
Mysql odbc support bind params array for select statement.
But when I use otl_steam to do multi select .
Otl send sql statement when << , how to use flush() send multi select to mysql odbc?
Mysql odbc need call SQLSetStmtAttr(SQL_ATTR_PARAMSET_SIZE) to set array_size
And SQLBindParameter to bind params array.
This is work in INSERT statement. Because INSERT statement execute when flush()。And first param for exec() is Params array_size。
But for SELECT statement,first param for exec() is 1 in rewind() method.
Code:
void select()
{
otl_nocommit_stream o;
o.open(1024,”select f1,f2 from test_tab where f1 =:f1<int>”,db,otl_implicit_select); </int>
for(int i=0,i< 200;i++)
o << i;
}
o.flush(); o.commit(); }
Log in to post a comment.
Hi,
I have some questions for use otl and mysql.
Mysql odbc support bind params array for select statement.
But when I use otl_steam to do multi select .
Otl send sql statement when << , how to use flush() send multi select to mysql odbc?
Mysql odbc need call SQLSetStmtAttr(SQL_ATTR_PARAMSET_SIZE) to set array_size
And SQLBindParameter to bind params array.
This is work in INSERT statement. Because INSERT statement execute when flush()。And first param for exec() is Params array_size。
But for SELECT statement,first param for exec() is 1 in rewind() method.
Code:
void select()
{
otl_nocommit_stream o;
o.open(1024,”select f1,f2 from test_tab where f1 =:f1<int>”,db,otl_implicit_select); </int>
for(int i=0,i< 200;i++)
{
o << i;
}
o.flush();
o.commit();
}