• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

Oracle Pro*C/C++游标和存储过程性能测试报告

发布: 2009-6-22 10:28 | 作者: 不详 | 来源: 领测软件测试网采编 | 查看: 228次 | 进入软件测试论坛讨论

领测软件测试网

procedure get_R0BrdLib(

batch_size in integer,

found in out integer,

done_fetch out integer,

BoardType1 out numArrayType,/*单板类型Board Type*/

BoardName1 out charArrayType/*各子单元类型包含的子单元个数Sunit Number Per Type*/) is

begin

if not CUR_R0BrdLib%isopen then

open CUR_R0BrdLib;

end if;

done_fetch := 0;

found := 0;

for i in 1..batch_size loop

fetch CUR_R0BrdLib

into BoardType1(i),BoardName1(i);

if CUR_R0BrdLib%notfound then

close CUR_R0BrdLib;

done_fetch := 1;

exit;

else

found := found + 1;

end if;

end loop;

end get_R0BrdLib;

end testEptTbl;

/

show err


    1.3.2 游标方式:


//倒出数据到zdb

void CBOARDT::WriteZdb(int SubNetID,int NodeBID)

{


EXEC SQL BEGIN DECLARE SECTION;

int iSubNetID = SubNetID;

int iNodeBID = NodeBID;

EXEC SQL END DECLARE SECTION;


char tmpbuf[128],StartTime[256],EndTime[256];

/* Set time zone from TZ environment variable. If TZ is not set,

* the operating system is queried to obtain the default value

* for the variable.

*/

_tzset();


/* Display operating system-style date and time. */

_strtime( tmpbuf );

sprintf( StartTime,%22OS time:\t\t\t%s\n%22, tmpbuf );


/* Declare a cursor for the FETCH. */

EXEC SQL DECLARE CUR_R_BOARDT CURSOR FOR

SELECT byBoardType, abyBoardName FROM TB_BOARDT;


EXEC SQL OPEN CUR_R_BOARDT;


/* Initialize the number of rows. */

num_ret = 0;


int rows_ret=BATCHSIZE;

while (BATCHSIZE == rows_ret)

{

// Fetch from the Cursor, catching all ORA ERROR condition

EXEC SQL WHENEVER SQLERROR DO sqlerror(m_dbheader);

EXEC SQL FETCH CUR_R_BOARDT INTO

:bHostVar1,:chHostVar1;


/* Write however many rows were returned. */

rows_ret=sqlca.sqlerrd[2] - num_ret;

WriteBatchToZdb(rows_ret,%22b01c01%22);

num_ret = sqlca.sqlerrd[2]; /* Reset the number. */

}


/* Write remaining rows from last fetch, if any. */

if ((sqlca.sqlerrd[2] - num_ret) > 0)

WriteBatchToZdb(sqlca.sqlerrd[2] - num_ret,%22b01c01%22);


延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/

43/4<1234>

关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网