... copied tempo2sql(dbtmp7,tRepos,cField) And this is the Function that creates, inserts and deletes the temporal table (quite complicated, isn't it?) Function tempo2sql(tempdb,realdb,cField0) local oCn cTemporal:=tempdb cRealdb:=realdb cFields=cField0 cTabtem:=cFilename(cTemporal) ...