Same Cursor name used in Program and Subprogram
Posted: Fri Oct 31, 2014 4:13 pm
Hi All,
I have two Programs - Program A and Program B . In Program A, I have 1 cursor with name Cursor1.
I declared the cursor and then opened it, after opening the cursor I called Program B[my cursor1 of Program A is still open]. In Program B also 1 declared and open another cursor named Cursor1.{Program A and Program B cursors are on different tables but unknowingly they have same names}.
As I have seen in same program we can't open two cursors with same name, will the above scenario give Sqlcode -502 or it will execute without any issue or we will get error during precompile time ?
Please share your thoughts.
Note: I don't have terminal now to test this scenario that's I want to discuss with you guys.
I have two Programs - Program A and Program B . In Program A, I have 1 cursor with name Cursor1.
I declared the cursor and then opened it, after opening the cursor I called Program B[my cursor1 of Program A is still open]. In Program B also 1 declared and open another cursor named Cursor1.{Program A and Program B cursors are on different tables but unknowingly they have same names}.
As I have seen in same program we can't open two cursors with same name, will the above scenario give Sqlcode -502 or it will execute without any issue or we will get error during precompile time ?
Please share your thoughts.
Note: I don't have terminal now to test this scenario that's I want to discuss with you guys.