51Testing软件测试论坛

标题: vu脚本疑惑 [打印本页]

作者: yg_82    时间: 2004-7-29 16:20
标题: vu脚本疑惑
如下脚本:
#include <VU.h>
{

push Timeout_scale = 200; /* Set timeouts to 200% of maximum response time */
push Think_def = "LR";
Min_tmout = 120000;       /* Set minimum Timeout_val to 2 minutes          */
push Timeout_val = Min_tmout;

DP1 = datapool_open("yyy1");
datapool_fetch(DP1);
              
XornDB = sqlserverattach("XornDB", "XornDB", "oracle8.1");

{ INFO SERVER "XornDB"="192.168.10.8"; } /*1*/

set Server_connection = XornDB;

push Think_avg = 0;
sessid_1 = sqlsessionbegin ["yyy1001"] "Xorn", LOOKUP_PWD;

sqlsessioncontrol ["yyy1002"] sessid_1, CURSESSID;


#if 0
IS_VALID=0
#endif
set Think_avg = 344;

stmtid_1_id = sqldeclare_cursor["yyy1003"] "", "SELECT MAIN_CODE, NAME, IS_VALID, MEMO FROM CODE WHERE (IS_VALID <> "
     + datapool_value(DP1, "IS_VALID")+
     " )";

datapool为自动产生。
上面这句话是什么意思:
sessid_1 = sqlsessionbegin ["yyy1001"] "Xorn", LOOKUP_PWD;

这句话中的数据又是从什么地方来?
stmtid_1_id = sqldeclare_cursor["yyy1003"] "", "SELECT MAIN_CODE, NAME, IS_VALID, MEMO FROM CODE WHERE (IS_VALID <> "
     + datapool_value(DP1, "IS_VALID")+
     " )";
我找了datapool中的项,不存在"IS_VALID"啊
作者: pcl2004_27    时间: 2004-7-29 16:56
sqlsessionbegin 命令id ,登陆用户,密码
  LOOKUP_PWD 是参数,它可以自动查找密码


  IS_VALID找不到,你打开datapool information下边看看,列名写得很明显

  应该在你的脚本下边还有
DATAPOOL_CONFIG datapool_name flags
{

   directive, "col_name" [,"data_type" [,"data_value"]];
   ...
   directive, "col_name" [,"data_type" [,"data_value"]];
}

上边你对照下,应该就知道了!
作者: yg_82    时间: 2004-7-29 17:05
thanks very much.
我是个初学者,在你的帮助下收获很大。
作者: yg_82    时间: 2004-7-29 17:12
标题: 下面是全部脚本,没你说的那东西啊!
/*
      ->-> Session File Information <-<-
       Created: Thu Jul 29 12:12:47 2004
          Name: E:\&sup2;&acirc;&Ecirc;&Ocirc;\TestDatastore\DefaultTestScriptDatastore\TMS_Sessions\ygq729.wch
          Type: Rational Robot - API
                (with Oracle OCI)
                (with Winsock1 Data)
*/

#include <VU.h>
{

push Timeout_scale = 200; /* Set timeouts to 200% of maximum response time */
push Think_def = "LR";
Min_tmout = 120000;       /* Set minimum Timeout_val to 2 minutes          */
push Timeout_val = Min_tmout;

DP1 = datapool_open("yyy1");
datapool_fetch(DP1);
              
XornDB = sqlserverattach("XornDB", "XornDB", "oracle8.1");

{ INFO SERVER "XornDB"="192.168.10.8"; } /*1*/

set Server_connection = XornDB;

push Think_avg = 0;
sessid_1 = sqlsessionbegin ["yyy1001"] "Xorn", LOOKUP_PWD;

sqlsessioncontrol ["yyy1002"] sessid_1, CURSESSID;


#if 0
IS_VALID=0
#endif
set Think_avg = 344;

stmtid_1_id = sqldeclare_cursor["yyy1003"] "", "SELECT MAIN_CODE, NAME, IS_VALID, MEMO FROM CODE WHERE (IS_VALID <> "
     + datapool_value(DP1, "IS_VALID")+
     " )";


set Think_avg = 0;

sqlopen_cursor ["yyy1004"] stmtid_1_id;


set Think_avg = 79;
push CS_blocksize = 134;

sqlfetch_cursor ["yyy1005"] stmtid_1_id, ALL_ROWS;

set Think_avg = 156;

sqlfree_cursor( stmtid_1_id );


#if 0
IS_VALID=0
#endif
set Think_avg = 78;

stmtid_1_id = sqldeclare_cursor["yyy1006"] "", "SELECT CODE_ITEM_ID, "
     "MAIN_CODE, NAME, IS_VALID, MEMO, ORDINAL_NO FROM CODE_ITEM WHERE "
     "(IS_VALID <> "
     + datapool_value(DP1, "IS_VALID")+
     " )";


set Think_avg = 0;

sqlopen_cursor ["yyy1007"] stmtid_1_id;


set Think_avg = 31;
set CS_blocksize = 111;

sqlfetch_cursor ["yyy1008"] stmtid_1_id, ALL_ROWS;

set Think_avg = 172;

sqlfree_cursor( stmtid_1_id );


sqlserverdetach(XornDB);

pop [Think_def, Think_avg, Timeout_val, Timeout_scale];

pop CS_blocksize;

}

DATAPOOL_CONFIG "yyy1"  OVERRIDE DP_NOWRAP DP_SEQUENTIAL DP_SHARED
{
        EXCLUDE, "IS_VALID", "string", "0";
}

另外,你说的datapool information是tools->manage->datapools->edit吗?
但是我没有找到啊
作者: yg_82    时间: 2004-7-30 11:21
找到了,谢谢




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2