//倒出数据到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,"OS time:\t\t\t%s\n", 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,"b01c01");
}while(!done_flag);
m_dbheader.dbTupleNum=TupleNum;
_strtime(tmpbuf);
sprintf(EndTime,"OS time:\t\t\t\t%s\n", tmpbuf );
printf("brdlib begin time: %s\n",StartTime);
printf("end time: %s\n",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;
}