Mauricio Pastorini Mauricio Pastorini - 8 days ago 5
SQL Question

Start procedure from when it stops

I have a long procedure that I want to save the state. This is for starting from when it stops if something in the database happended.
How can I implement it in Oracle?

Answer

I Solved the problem. Thanks to comments I realized that it's not posible to put some start poin in procedure.

I've created an aux table ProcState where I saved the state of the procedure. When I start the procedure, through a Query I loop in registers that I've not inserted in ProcState

When the procedure runs, I insert and commit the validations that I dont want to check againg if the DBMS breaks.

Finally, when procedure ends I delete all registers in ProcStatefor starting from 0 the next time.

Hope It helps somebody.