1

我似乎无法找到解决方案。我在报告中修改了 Fetch 方法,因此如果更改了 queryRun 并获取了新 ID,则 while 循环重新开始,出现一个新页面并执行 2 个元素。这部分工作正常,下一部分没有,在每个 ID 中有几条记录,我正在使用 Element.Execute(); 和 element.Send(); 来处理。发生的情况是,选择了第一个 ID,执行报告的元素(正文)并按预期发送元素,但是 while 循环没有进入下一个 ID?

这是代码;

public boolean fetch()
{
    APMPriorityId           oldVanId, newVanId;
    LogisticsControlTable   lLogisticsControlTable;
    int64                   cnt, counter;
    ;

    queryRun = new QueryRun(this);

    if (!queryRun.prompt() || !element.prompt())
    {
        return false;
    }

    while (queryRun.next())
    {
        if (queryRun.changed(tableNum(LogisticsControlTable)))
        {
            lLogisticsControlTable = queryRun.get(tableNum(LogisticsControlTable));
            if (lLogisticsControlTable)
            {
                info(lLogisticsControlTable.APMPriorityId);
                cnt      = 0;
                oldVanId =  newVanId;
                newVanId =  lLogisticsControlTable.APMPriorityId;

                if(newVanId)
                {
                    element.newPage();
                    element.execute(1);
                    element.execute(2);
                }
            }

            if (lLogisticsControlTable.APMPriorityId)

            select count(recId) from lLogisticsControlTable where lLogisticsControlTable.APMPriorityId == newVanId;
            counter = lLogisticsControlTable.RecId;

            while select lLogisticsControlTable where lLogisticsControlTable.APMPriorityId == newVanId
            {
                cnt++;

                if(lLogisticsControlTable.APMPriorityId == newVanId && cnt <= counter)
                {
                    element.execute(3);
                    element.send(lLogisticsControlTable);
                }
            }
        }
    }
    return true;
}
4

1 回答 1

0

您正在lLogisticsControlTable用作 aqueryRun.get()和 a的目标while select。然而,这两种用途相互干扰;有两个 SQL 游标要控制。

使用两个不同的记录变量。

于 2012-04-10T17:26:06.883 回答