|
lr测试c/s结构系统,选择odbc协议录制了一个添加员工操作。脚本回放时出错如下:
Action.c(154): lrdb_stmt: "SQLExecDirect", return-code=-1, native-error-code=1062, SQLState=23000, SQLError=Duplicate entry '50' for key 1
Action.c(154): lrd_stmt: ERROR, return-code=LRDE2009. INSERT INTO tb_personinfo( piid, piname, ***, nickname, webname, webpwd, gi_id, title, tele, mail, enable )VALUES( 50, '新员工', 0, '', '', '', 0, '', '', '', 1 )
录制脚本如下:
/*添加员工*/
lr_think_time(14);
lrd_open_cursor(&Csr10, Con1, 0);
lrd_db_option(Csr10, OT_ODBC_QUERY_TIMEOUT, (void FAR const *)30, 0);
lrd_db_option(Csr10, OT_ODBC_CURSOR_STATIC, 0, 0);
lrd_stmt(Csr10, "SELECT * FROM tb_personinfo ORDER BY piid DESC LIMIT 1", -1, 1 /*Direct exec*/, 0 /*None*/, 0);
lrd_db_option(Csr10, OT_ODBC_RETRIEVE_DATA, "OFF", 0);
lrd_db_option(Csr10, OT_ODBC_RETRIEVE_DATA, "ON", 0);
lrd_bind_cols(Csr10, BCInfo_D103, 0);
lrd_fetchx(Csr10, 1, 2, 0, PrintRow20, 1, 0);
GRID(20);
lrd_db_option(Csr10, OT_ODBC_CURSOR_UNBOUNDCOLS, 0, 0);
lrd_db_option(Csr10, OT_ODBC_CURSOR_CLOSE, 0, 0);
lrd_db_option(Csr10, OT_ODBC_CURSOR_CLOSE, 0, 0);
lrd_close_cursor(&Csr10, 0);
lrd_open_cursor(&Csr11, Con1, 0);
lrd_db_option(Csr11, OT_ODBC_QUERY_TIMEOUT, (void FAR const *)30, 0);
lrd_stmt(Csr11, "INSERT INTO tb_personinfo( piid, piname, ***, nickname, webname, "
"webpwd, gi_id, title, tele, mail, enable )VALUES( 50, "
"'新员工', 0, '', '', '', 0, '', '', '', 1 )", -1, 1 /*Direct exec*/, 0 /*None*/, 0);
最后三行为出错行。请大家帮忙!谢谢!~~ |
|