Subject Re: [firebird-support] Re: Inserting 100's of thousands from a SP
Author Adomas Urbanavicius
Such long time consuming procedure, we usually split into parts:
Usually it calculates complex totals for order transactions,etc; so it
is dependant on time.
Lets say we write clever procedure P_X (DATE_FROM DATE , DATE_TILL
DATE ).
So instead of firing this procedure with parameters
P_X('1800.01.01','2005.01.01'),
we use client app loop with small steps and commit (syntax just to
understand sample):

while (stop_date < HARD_STOP)

start_date=stop_date;
stop_date++;
try to execute P_X (start_date,stop_date)
commit;

This cycle will execute procedure just for one day,and will commit
everything. Now we need just to incapsulate it into nice thread with
progress showing up,cancel button,pause button and thats it :). The
advantage is that if system crashes, we can start calculation just from
crashpoint.


Adomas

>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Visit http://firebird.sourceforge.net and click the Resources item
>on the main (top) menu. Try Knowledgebase and FAQ links !
>
>Also search the knowledgebases at http://www.ibphoenix.com
>
>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>