I try insert new records over a record selection in the same table, but it shows an error " The record exist", I think this happens because the selection include the new record inserted.
CostCenter cCenter, cCenter_upd;
TransDate CountDays;
while select cCenter
{
CountDays = 01\01\2018;
while (CountDays != 01\01\2019)
{
//info(date2str(CountDays,1,2,4,2,4,4));
ttsBegin;
cCenter_upd.clear();
cCenter_upd.CostUnitId = cCenter.CostUnitId;
cCenter_upd.ShiftTime = cCenter.ShiftTime;
cCenter_upd.Speed = cCenter.Speed;
cCenter_upd.doInsert();
ttsCommit;
CountDays ++;
}
cCenter.delete();
}
How i can insert new records over the same selection?
it occurs to me to set them in a temporary table type variable, but I do not know how.
Can help me please, thanks in advance!
*This post is locked for comments
I have the same question (0)