2220 Cursor not open

Advantage Error Guide

Problem: An SQL script statement is attempting to access information from a cursor that has not been opened.

Solution: Check the error message for the location of the error in the script. Make sure the cursor has been opened before it is used.