Progress bar called from button on grid Application

I have a button in a grid application, I run a stored procedure with sc_exec_sql($insert_sql); I need to put a progress bar simulating that it is inserting something and that when it finishes it completes the progress bar. does anyone know how i can do this?

I have a project that loops through a series of files and runs a stored procedure on each. IIRC it’s using javascript to display a progress bar that shows the actual percentage of the files that have been processed along with a message (“currently processing file 6/10”). I don’t think that will work if you are only running a single stored procedure step.

The other option is to display an animated gif. I use that in another project to avoid having the user see a blank screen while a long process completes. That one is based on this: Can I make an app give a "loading..." message or animation?