Hi all,
In my application, I have stored procedures (TIBCStoredProc) that are created dynamically when certain forms are created. They are only freed when the form is destroyed.
The stored procedures get call multiple times (hundreds, if not thousands).
My question is, when should I call the prepare/unprepare methods? I can't seem to find clear information on this:
Do I only prepare the SP once at creation, or each time I change the parameter values?
What about UnPrepare?
Thanks!
When to call Prepare/Unprepare for stored procedures
-
- Posts: 52
- Joined: Thu 17 Dec 2009 08:25
You need to prepare the stored procedure once and then assign different parameter values before each execution.
As long as it is prepared, Firebird/InterBase holds a compiled version of the stored procedure in its metadata cache. If you don't need the stored procedure anymore, then unprepare it. Unpreparing should automatically happen when the TIBCStoredProc component gets freed e.g. upon freeing the form.
Hope this helps.
As long as it is prepared, Firebird/InterBase holds a compiled version of the stored procedure in its metadata cache. If you don't need the stored procedure anymore, then unprepare it. Unpreparing should automatically happen when the TIBCStoredProc component gets freed e.g. upon freeing the form.
Hope this helps.