sqlserver-ODBC数据库的问题
sqlserver的性能测试执行的是一个存储过程,执行存储过程,得到一个数字
可是每次在循环的时侯,都会报错
不知要如何处置,哪位大侠可以帮忙看一看
lrd_cancel(0, Csr2, 0 /*Unused*/, 0);
lrd_stmt(Csr2, "declare @P1 varchar(4000)\nset @P1='82000038000039192919'\ndeclare "
"@P2 varchar(4000)\nset @P2='002'\nexec GetNextPackCode "
"@TaskCode = '456', @PackType = '0', @LevelNo = '1', "
"@NextCode = @P1 output, @BoxNo = @P2 output\nselect @P1, "
"@P2\r\nupdate XPackCode set PackFlag='2' where PackCode="
"@P1\r\nupdate XPackCode set Status='2',ParentPackCode=@P1 "
"where PackCode='{NewParam_1}'\r\nupdate XPackCode "
"set Status='2',ParentPackCode=@P1 where PackCode="
"'{NewParam_2}'\r\nupdate XPackCode set Status='2',"
"ParentPackCode=@P1 where PackCode='{NewParam_3}'\r\n", -1, 1, 0 /*None*/, 0);
lrd_db_option(Csr2, OT_ODBC_CURSOR_UNBOUNDCOLS, 0, 0);
lrd_result_set(Csr2, 0, 0, 0);
lrd_db_option(Csr2, OT_ODBC_CURSOR_UNBOUNDCOLS, 0, 0);
lrd_result_set(Csr2, 0, 0, 0);
lrd_db_option(Csr2, OT_ODBC_CURSOR_UNBOUNDCOLS, 0, 0);
lrd_result_set(Csr2, 0, 0, 0);
lrd_db_option(Csr2, OT_ODBC_CURSOR_UNBOUNDCOLS, 0, 0);
lrd_result_set(Csr2, 0, 0, 0);
lrd_db_option(Csr2, OT_ODBC_CURSOR_UNBOUNDCOLS, 0, 0);
lrd_result_set(Csr2, 0, 0, 0);
lrd_bind_cols(Csr2, BCInfo_D100, 0);
lrd_save_col(Csr2,1,1,0,"Saved_D98");
lrd_fetch(Csr2, -1, 1, 0, PrintRow50, 0);
GRID(50);
lrd_db_option(Csr2, OT_ODBC_CURSOR_UNBOUNDCOLS, 0, 0);
lrd_result_set(Csr2, 0, 0, 0);
lrd_db_option(Csr2, OT_ODBC_CURSOR_UNBOUNDCOLS, 0, 0);
lrd_result_set(Csr2, 0, 0, 0);
lrd_db_option(Csr2, OT_ODBC_CURSOR_UNBOUNDCOLS, 0, 0);
lrd_result_set(Csr2, 0, 0, 0);
lrd_db_option(Csr2, OT_ODBC_CURSOR_UNBOUNDCOLS, 0, 0);
lrd_result_set(Csr2, 0, 0, 0);
lrd_db_option(Csr2, OT_ODBC_CURSOR_UNBOUNDCOLS, 0, 0);
lrd_result_set(Csr2, 0, 0, 0);
lrd_cancel(0, Csr2, 0 /*Unused*/, 0);
lrd_cancel(0, Csr2, 0 /*Unused*/, 0);
lrd_cancel(0, Csr2, 0 /*Unused*/, 0);
报错:
Action.c(324): lrdb_fetchx:"SQLFetch", return-code=-1, native-error-code=0, SQLState=24000, SQLError=无效的游标状态
Action.c(324): lrd_fetch: ERROR, return-code=LRDE2009.0 row(s) fetched
每次迭代的时侯,都会报这个错误 没做过此类测试,不过一般说来回放出错,是因为没有做关联!
回复 2# 的帖子
已经做过关联了lrd_save_col(Csr2,1,1,0,"Saved_D98");
页:
[1]