Of course, but you have to do that in SQL, not Pascal.
Reason: SQL is more efficient on the underlying database operations. Pascal would call the SQL engine anyway (in a loop).
Note not every SQL db supports this, so it is also dependent on which database you use.
A simple strategy is to use a TBufDataset and when finished commit to the database.