Код (неработающий) выглядит так:
PHP код:
ttsbegin;
exportQueryRun = new QueryRun(query);
query.dataSourceNo(2).update(true);
while (exportQueryRun.next())
{
standardCostTable = exportQueryRun.getNo(2);
if (cchkPlanStandCostDate.value())
standardCostTable.PlanStandCostDate = str2date(cPlanStandCostDate.text(),123);
if (cchkPlanStandCostCur.value())
standardCostTable.PlanStandCostCur = cPlanStandCostCur.text();
if (cchkPlanORCur.value())
standardCostTable.PlanORCur = cPlanORCur.text();
if (cchkPlanStandCostValue.value())
{
if (cPlanStandCostValue.realValue()!=0.00)
standardCostTable.PlanStandCostValue = cPlanStandCostValue.realValue();
else if (cPlanStandCostPercent.realValue()!=0.00)
standardCostTable.PlanStandCostValue = standardCostTable.PlanStandCostValue
* cPlanStandCostPercent.realValue()/100+1;
else if (cPlanStandCostAddValue.text()!="0.00")
standardCostTable.PlanStandCostValue = standardCostTable.PlanStandCostValue
+ cPlanStandCostPercent.realValue();
if (standardCostTable.recid==0)
standardCostTable.insert();
else
standardCostTable.update();
}
}
ttscommit;
standardCostTable - это вторая, "правая" таблица из JOIN