I am designing a COBOL program that does 2 things.
1 reads specific rows from a table, and inserts a new row based on the original.
2 reads different rows from the same table, and updates those rows.
Is it bad standards to have 2 initialization procedures? I need to declare 2 SQL cursors, one for each task. So I was thinking:
1 initialize cursor, 2 process, 3 initialize cursor, 4 process.
But that seems like bad logic. something is telling me it should be more like:
1 initialize cursor, 2 process But I'm having trouble thinking it out because to me, they are 2 separate tasks.
I tried to think of a way that my SQL query could do the work, and then I could just do some validation. But I'm not sure the query would be any more efficient than having a second read of the table.
Here's my structure ideas
I've added a 3rd chart that I believe follows the answer given to me on this question. Does the 3rd chart seem to me the most logical?