Inconsistent indicator variables for this cursor

You have used an indicator variable when one was not previously used with the cursor, or you have not used an indicator variable
when one was previously used with the cursor. Indicator variable usage must be consistent for the cursor.