• Change the statement

    DECLARE c CURSOR FOR

    to

    DECLARE c CURSOR LOCAL FAST_FORWARD READ_ONLY FOR

    and test the speed difference.