You are using global cursor that will be defined each time you are calling this procedure and give you the same error.
Define a local cursor. Just put the keyword LOCAL
after CURSOR
:
declare detailsCursor CURSOR LOCAL FOR
...
You are using global cursor that will be defined each time you are calling this procedure and give you the same error.
Define a local cursor. Just put the keyword LOCAL
after CURSOR
:
declare detailsCursor CURSOR LOCAL FOR
...