Recent

Author Topic: Is SQLDB able to do array fetch/update/insert?  (Read 368 times)

Pascal

  • Hero Member
  • *****
  • Posts: 829
Is SQLDB able to do array fetch/update/insert?
« on: June 13, 2019, 01:26:41 pm »
Is SQLDB able to do array fetch/update/insert to improve performance?
laz trunk - fpc trunk 32bit - Windows 10 Pro x64 (1803)

Thaddy

  • Hero Member
  • *****
  • Posts: 8458
Re: Is SQLDB able to do array fetch/update/insert?
« Reply #1 on: June 13, 2019, 06:00:03 pm »
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.
« Last Edit: June 13, 2019, 06:08:12 pm by Thaddy »
Read the manuals and if you are a professional get a proper education in computer science. Makes the forum a lot cleaner.

Pascal

  • Hero Member
  • *****
  • Posts: 829
Re: Is SQLDB able to do array fetch/update/insert?
« Reply #2 on: June 13, 2019, 09:16:14 pm »
Are there any samples?

20 years ago i used DOA (Allround Automations) for Delphi, which was able to do array DML with Dataset component.
laz trunk - fpc trunk 32bit - Windows 10 Pro x64 (1803)