An OPEN, FETCH or CLOSE statement references a cursor name that was not DECLAREd.
The DECLARE CURSOR statement must be coded before an OPEN, FETCH or CLOSE SQL statement. If defined, move the DECLARE CURSOR statement before the statement in error. Otherwise, check to make sure the cursor name used in the DECLARE CURSOR statement matches the cursor name used in the SQL statement in error.