Recent

Author Topic: ZQuery vs ZReadOnlyQuery  (Read 2301 times)

k1attila1

  • Full Member
  • ***
  • Posts: 105
ZQuery vs ZReadOnlyQuery
« on: April 27, 2017, 05:13:46 pm »
Hi

Could somebody tell me what is the difference between

ZQuery + Readonly=True and ZReadOnlyQuery ?

Mainly speed ? or somthing else ? (FireBird SQL)

Thank you Attila

Zoran

  • Hero Member
  • *****
  • Posts: 1829
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: ZQuery vs ZReadOnlyQuery
« Reply #1 on: April 27, 2017, 06:18:02 pm »
Short answer: no difference.

Long answer:

ZReadOnlyQuery descends directly from ZReadOnlyDataSet, and ZQuery descends from ZDataSet, which then also descends from ZReadOnlyDataSet, but adds functionalities of cashing and updating.

So, ZReadOnlyQuery is "lighter".

In practise, you can hardly notice any difference.
If you are absolutely sure that you will use it only for reading, use ZReadOnlyQuery.
If you are not sure if you might want later to decide to use it for updating, use ZQuery with ReadOnly = True, so you can easily set it later to False and use it for updating database.
« Last Edit: April 27, 2017, 06:49:59 pm by Zoran »

k1attila1

  • Full Member
  • ***
  • Posts: 105
Re: ZQuery vs ZReadOnlyQuery
« Reply #2 on: April 27, 2017, 06:28:01 pm »
Thank you Zoran !

I understand.

Attila

 

TinyPortal © 2005-2018