ORA-01001 Raised in 10g and Higher After Upgrade from 9i (Doc ID 1075385.1)

Last updated on JULY 17, 2017

Applies to:

PL/SQL - Version: 10.1.0.2 to 11.2.0.1 - Release: 10.1 to 11.2
Information in this document applies to any platform.

Symptoms

PL/SQL block which ran fine in 9i now fails in 10g.  Removing exception handling we are able to determine that the error ORA-01001 is raised within a cursor for .. loop.

set serveroutput on

DECLARE
 cursor my_cur is select * from dual;
 i number := 1;
BEGIN
 FOR my_rec in my_cur LOOP
  dbms_output.put_line('i ' || i );
  FETCH my_cur INTO my_rec;
  i := i+1;
 END LOOP;
END;
/

DECLARE
*
ERROR at line 1:
ORA-01001: invalid cursor
ORA-06512: at line 7

Changes

Upgrade Oracle from using an earlier version [up to 9.2] PL/SQL (to any higher version).

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms