Subject Re: [firebird-support] Re: Progress of a Stored Procedure Feedback
Author Martijn Tonies
> > I have this stored procedure that injects data from
> > an external table into my database.
> > It seems to take forever.
> > Is there any way in PSQL I can get this stores procedure to
> > give me feedback on its progress?
>
> There are several ways you can achieve this, but any feedback will
> slow down the process.
>
> Here are some ideas:
>
> * Create an output parameter called recordsprocessed, increment it
> and suspend inside your for select loop. This will seriously slow it
> down, so perhaps only suspend every 10000 records or so (like gbak).
> If you have triggers in the picture, you may need to reduce the
> number of records between suspends to give satisfactory feedback.
>
> select RecordsProcessed
> from PROC_EXT_FIELD3SALES(.....)

Just a note -- using SUSPEND makes the procedure select-able
and the select is then REQUIRED in order to make the procedure
process all rows. If you don't ask for the "next output record", your
procedure will just halt.

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com