I've created a function that allows me to do an huge update.
But I need to limit this function. I need to do 50k rows (example) and then stop it. After that I need to continue from the rows that I've stopped... I'll have to modify the call function select batch_number() as well.
How can I do that? Using for?
The function below is already working, but, the table has 40m rows. And it's taking years.
Do you need to run the function on any Staging(Not Production). I mean, do you want to run this batch processes on a single transaction.
If not, I had the similar problem, where I needed to implement a function, which we can run in multiple sessions. I ran this function in one of the BI servers, where we have around 5 Million records.