A variable has been declared twice in the same scope. See the IBM Informix Guide to SQL: Tutorial for an explanation of the scope of procedural variables.
This error can also be seen when a DECLARE (or PREPARE) uses identifier same as one of the declared procedural variables. Choose a different cursor name or statement id instead.
For example, following DECLARE statement incorrectly uses cursor name same as procedural variable:
DEFINE spl_var INTEGER; ... DECLARE spl_var CURSOR FOR stmt_id1;
Following code fixes the issue in above sample code:
DEFINE spl_var INTEGER; ... DECLARE cur_id CURSOR FOR stmt_id1;