Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 5 of 5 total |
Prepare v Open.. |
Sun, Jun 9 2019 6:16 PM | Permanent Link |
Ian Branch | Hi Team,
I am reviewing some of the code I did when i was starting out with EDB and came across the folllowing.. {code} // JobTickets.Prepare; JobTickets.Open; // {code} JobTickets is a TEDBQuery and the record is opened or some editing. Now, if I read the help on Prepare the Open is redundant. Yes/No? Alternatively, again if I read the help on Prepare correctly, the Open will do it anyway. Yes/No? Regards, Ian |
Sun, Jun 9 2019 6:17 PM | Permanent Link |
Ian Branch | Hmmm. Can't edit the above.
If they both effectively achieve the same thing, is there a benefit of one over the other? |
Sun, Jun 9 2019 7:48 PM | Permanent Link |
Raul Team Elevate | On 6/9/2019 6:17 PM, Ian Branch wrote:
> Hmmm. Can't edit the above. > If they both effectively achieve the same thing, is there a benefit of one over the other? They are not the same thing - Prepare is optional, Open is not (or ExecSQL in case you're not returning any data). You have to call Open or ExecSQL. Prepare is only really useful when you have parameters in your query - in that case you can prepare once and then execute multiple times which can be faster than 3 separate prepare/execute steps. Raul |
Sun, Jun 9 2019 7:55 PM | Permanent Link |
Ian Branch | Ahhhh. Tks Raul. Much appreciated for the clarification.
In the cases I have I can remove the Prepare. Ian |
Sun, Jun 9 2019 9:49 PM | Permanent Link |
Raul Team Elevate | On 6/9/2019 7:55 PM, Ian Branch wrote:
> Ahhhh. Tks Raul. Much appreciated for the clarification. > In the cases I have I can remove the Prepare. yes - open is enough in your case of no parameters Raul |
This web page was last updated on Monday, April 29, 2024 at 05:23 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |