loadrunner 2-Tier 如何将获取的返回值打印至日志
Action部分的脚本如下。执行oracle数据库中的一个存储过程,并将存储过程的执行结果存入OraStm8对象中。
OraStm8为一个数组。
请高手指点,如何将OraStm8的数据打印到日志中。
Action()
{
lr_think_time(1);
//static LRD_VAR_DESC NAME_D13 ={LRD_VAR_DESC_EYECAT, 500, 8, LRD_DBTYPE_ORACLE, {1, 0, 0},DT_VARCHAR};
lrd_ora8_handle_alloc(OraEnv1, STMT, &OraStm7, 0);
lrd_ora8_stmt(OraStm7, "DECLARE\nIN_USERID VARCHAR2(200);\nIN_AREACODE VARCHAR2(200);\n "
" IN_CERTTYPE VARCHAR2(200);\nIN_CERTMEDIANO VARCHAR2(200);"
"\nIN_OPROFLAG VARCHAR2(200);\nIN_EXPIREDATE VARCHAR2"
"(200);\nIN_NETCODE VARCHAR2(5);\nOUT_PROCSIGN VARCHAR2"
"(200);\n\nBEGIN\nIN_USERID := 'test.p.0200';\n"
"IN_AREACODE := '0200';\nIN_CERTTYPE := '4';\n"
"IN_CERTMEDIANO := '4300000686';\nIN_OPROFLAG := '1';\n"
"IN_EXPIREDATE := '20151205';\nIN_NETCODE := '00204';\n"
"OUT_PROCSIGN := NULL;\n\n"
"PEBANK.PROC_PERSON_CERTSTATOPRLOG ( IN_USERID, IN_AREACODE, "
"IN_CERTTYPE, IN_CERTMEDIANO, IN_OPROFLAG, IN_EXPIREDATE, "
"IN_NETCODE, OUT_PROCSIGN );\n\nDBMS_OUTPUT.Put_Line"
"('OUT_PROCSIGN = ' || OUT_PROCSIGN);\n\n"
"DBMS_OUTPUT.Put_Line('');\n\nCOMMIT;\nEND;", 1, 0, 0);
lrd_ora8_exec(OraSvc1, OraStm7, 1, 0, &uliRowsProcessed, 0, 0, 0, 0,
0);
lrd_ora8_handle_alloc(OraEnv1, STMT, &OraStm8, 0);
lrd_ora8_stmt(OraStm8, "BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;", 1, 0, 0);
lrd_ora8_bind_placeholder(OraStm8, &OraBnd2, "1", &P1D12,
LRD_BIND_BY_POS | LRD_BIND_AS_ARRAY, 0, 0);
lrd_assign(&P2D13, "25", 0, 0, 0);
lrd_ora8_bind_placeholder(OraStm8, &OraBnd3, "2", &P2D13,
LRD_BIND_BY_POS, 0, 0);
lrd_ora8_exec(OraSvc1, OraStm8, 1, 0, &uliRowsProcessed, 0, 0, 0, 0,
0);
GRID0(12);
//lrd_ora8_bind_col(OraStm8, &OraDef37, 1, &NAME_D13, 0, 0);
//lrd_ora8_save_col(OraStm8,1,1,0,"a");
//lrd_ora8_fetch(OraStm8, 2,2, &uliFetchedRows, 0, 2, 0, 0);
//lr_output_message("%s.%s",lr_eval_string("{&P2D13}"));
// lr_log_message("sql result: %s", lr_eval_string_ext(OraStm8));
lrd_handle_free(&OraStm8, 0);
lrd_handle_free(&OraStm7, 0);
return 0;
}
[ 本帖最后由 yihanyan 于 2010-4-27 09:55 编辑 ] 没接触过oracle协议,帮你顶了,顺便关注
页:
[1]