set Kdo,$(User) jump.ifeq Kdo,ladouch,Smis jump.ifeq Kdo,crzucha,Smis exit.show.message Sorry, to nesmite. Smis: startsql select distinct P.Zarizeni,K.Zavod from Poruchy P,Kmen K where K.Zarizeni=P.Zarizeni and K.Zavod<>P.Zavod f.create c:\tmp\konsolidace.sql Loop: ?getsql EndLoop f.write !update poruchy set zavod='$(Zavod)' where Zarizeni='$(Zarizeni)' ; f.write commit; jump Loop EndLoop: stopsql f.write exit; f.close viewer c:\tmp\konsolidace.sql exit