How I can delete all records from data set lazarus / 16-Databases ---------------------------------------------------------------------- ribarvlada · 2011-08-18 19:29 I use Zeoslib 7 . I need to delete all records from my table. Can I use something like Clipper's command ZAP or  function DBZAP(). I was found DataSet.EmptyDataSet, but nothin was deleted. Then I try :  ZQueryRacun.Open;   ZQueryRacun.First;   while not ZQueryRacun.EOF do begin     ZQueryRacun.Delete;   end; but I'm afraid that it is very slow for large database. ---------------------------------------------------------------------- eny · 2011-08-18 19:43 Can't you execute SQL? Something like: DELETE FROM ? ---------------------------------------------------------------------- Arbee · 2011-08-18 19:54 What kind of database do you have?  Some SQL "dialects" have something like a TRUNCATE TABLE, which is especially devoted to deleting everything in a table very fast. ---------------------------------------------------------------------- eny · 2011-08-18 20:17 Quote from: Arbee on August 18, 2011, 09:54:24 pmWhat kind of database do you have?  Some SQL "dialects" have something like a TRUNCATE TABLE, which is especially devoted to deleting everything in a table very fast. TRUNCATE TABLE is not really SQL; Oracle for example supports this but you need special permissions for it. ---------------------------------------------------------------------- joseme · 2011-08-18 20:47 ZQueryRacun.Close; ZQueryRacun.SQL.Text:='delete from mytable'; ZQueryRacun.ExecQuery; ---------------------------------------------------------------------- ribarvlada · 2011-08-18 20:55 Thanks all of you! ---------------------------------------------------------------------- SteveF · 2011-08-19 15:59 If you're migrating from an Xbase-type DBMS (dBase, FoxPro et al) to a SQL DBMS (MySQL, PostgreSQL, Firebird, etc) I highly recommend finding a good basic book on SQL.  Many things which require the step-like iteration through the records in an Xbase system can be done much more efficiently in SQL--if one knows how.  The book will supply that information. Steve