Recent

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

Pascal

  • Hero Member
  • *****
  • Posts: 932
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 x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
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 »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Pascal

  • Hero Member
  • *****
  • Posts: 932
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 x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

 

TinyPortal © 2005-2018