References to SQL cursor names
A cursor name can only be referenced within the compound statement in which it is declared, including any compound statements that are nested within that compound statement.
The name of an SQL cursor can not be the same as the name of another SQL cursor that is declared on the same routine. The compound-statement that contains the declaration of an SQL cursor name determines the scope of that cursor name. A cursor name can only be referenced within the compound statement in which it is declared, including any compound statements that are nested within that compound statement. See compound-statement for additional information.