Delphi XE8 - MS Access / PostgreSQL

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
AlainANTOCI
Posts: 21
Joined: Wed 07 Apr 2021 07:48

Delphi XE8 - MS Access / PostgreSQL

Post by AlainANTOCI » Wed 07 Apr 2021 08:05

Hi,

I use Delphi XE8. I have an old application working with Delphi XE8 and DBMS was MS Access 97 to 2003 working with ADO (TADOQuery). The new version of the application will be with Unidac an postgreSQL, I've finish the transfert but I don't notice a lot of increase speed in some operation. For example I import data from xml file and put them into differents tables :
1) ReadXml
2) Data to temporary tables less faster than ADO, I use :
TUniQuery.Sql.Text := 'SELECT * FROM MyTable WHERE (0 = 1)'
TUniQuery.Open;
TUniQuery.Insert;
TUniQuery.FieldByName('MyField').As.... := Value
....
TUniQuery.Post;

I try do write 'INSERT INTO ....' instead, same result.

Can I do it in a different way, I have to insert 20000 value, it take 8 minutes ?

Regards

FCS
Posts: 176
Joined: Sat 23 Feb 2013 18:46

Re: Delphi XE8 - MS Access / PostgreSQL

Post by FCS » Wed 07 Apr 2021 11:07

Hello,

Try open transaction before data importing and commit it at the end.

Regards
M.

evgeniym
Devart Team
Posts: 103
Joined: Thu 13 May 2021 07:08

Re: Delphi XE8 - MS Access / PostgreSQL

Post by evgeniym » Fri 14 May 2021 06:39

Hi,
As alternative you may use following methods:
1. Form a multi-line SQL query and execute it at once.
2. Form a query with parameters and perform preparation using Prepare, and then, in a loop, assign values with paraments and add data using Execute.
3. Use batch update mechanism. You can find more information about batch updates in our PgDAC documentation:
https://www.devart.com/pgdac/docs/batchops.htm
Or in our blog:
https://blog.devart.com/using-batch-ope ... nents.html

Best regards,
Evgeniy

AlainANTOCI
Posts: 21
Joined: Wed 07 Apr 2021 07:48

Re: Delphi XE8 - MS Access / PostgreSQL

Post by AlainANTOCI » Mon 14 Jun 2021 11:33

Thanks batch was the solution.

evgeniym
Devart Team
Posts: 103
Joined: Thu 13 May 2021 07:08

Re: Delphi XE8 - MS Access / PostgreSQL

Post by evgeniym » Tue 15 Jun 2021 09:36

Hi Alain,
I’m glad that your issue is resolved and you can use all features of the software.
Please feel free to contact us anytime in case you have any other questions.

Best regards,
Evgeniy

Post Reply