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
Delphi XE8 - MS Access / PostgreSQL
Re: Delphi XE8 - MS Access / PostgreSQL
Hello,
Try open transaction before data importing and commit it at the end.
Regards
M.
Try open transaction before data importing and commit it at the end.
Regards
M.
Re: Delphi XE8 - MS Access / PostgreSQL
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
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
-
- Posts: 21
- Joined: Wed 07 Apr 2021 07:48
Re: Delphi XE8 - MS Access / PostgreSQL
Thanks batch was the solution.
Re: Delphi XE8 - MS Access / PostgreSQL
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
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