dtable="s0205valid.xls"; #以可写方式打开目标表
rc = ddt_open(dtable, DDT_MODE_READWRITE);
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open table."&dtable);
table = "s0205new.xls"; #以只读方式打开源表
rc = ddt_open(table, DDT_MODE_READ);
if (rc!= E_OK && rc != E_FILE_OPEN)
pause("Cannot open table."&table);
ddt_get_row_count(table,table_RowCount);
for(table_Row = 1; table_Row <= table_RowCount; table_Row ++)
{
ddt_set_row(table,table_Row);
s020011=ddt_val(table,"s0205new_id");#定义s020011获取源表当前参数s0205new_id的值
pause("the current s02001's value is "&s020011);#显示当前参数的值,测试用
rc1=ddt_set_val_by_row(dtable,table_Row,"s0205query_id",s020011);#将获取的值插入到目标表
if(rc1!=E_OK && rc1!=E_FILE_OPEN )
pause("cannot insert the value to "&dtable);
ddt_save(dtable);#保存目标表