m_dbheader.dbTupleNum=sqlca.sqlerrd[2];
EXEC SQL CLOSE CUR_R_BOARDT;
_strtime(tmpbuf);
sprintf(EndTime,%22OS time:\t\t\t\t%s\n%22, tmpbuf );
printf(%22begin time: %s\n%22,StartTime);
printf(%22end time: %s\n%22,EndTime);
WriteZdbHeader();
}
1.3.3 存储过程方式:
//倒出数据到zdb
void CBRDLIB::WriteZdb(int SubNetID,int NodeBID)
{
DWORD TupleNum=0;
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 );
do
{
EXEC SQL EXECUTE
BEGIN testEptTbl.get_R0BrdLib
(:array_size, :num_ret, :done_flag,:bHostVar1,:chHostVar1);
END;
END-EXEC;
TupleNum=TupleNum+num_ret;
// print_rows(num_ret);
WriteBatchToZdb(num_ret,%22b01c01%22);
}while(!done_flag);
m_dbheader.dbTupleNum=TupleNum;
_strtime(tmpbuf);
sprintf(EndTime,%22OS time:\t\t\t\t%s\n%22, tmpbuf );
printf(%22brdlib begin time: %s\n%22,StartTime);
printf(%22end time: %s\n%22,EndTime);
WriteZdbHeader();
}
/*-------------CTable Factory-----------------*/
CTable* CTable::Factory(int type)
{
switch( type )
{
//R0
case 2 :
return new CBOARDT;
break;
case 1 :
return new CBRDLIB;
break;
}
return NULL;
文章来源于领测软件测试网 https://www.ltesting.net/