My Oracle Support Banner

ORA-1002 When Fetching A Ref Cursor (Doc ID 413199.1)

Last updated on FEBRUARY 16, 2019

Applies to:

Precompilers - Version 9.2.0.8 and later
Information in this document applies to any platform.
***Checked for relevance on 17th Jan 2019***

Symptoms

In Pro*C program, calling a Stored Procedure/Function with an OUT ref cursor parameter using the "EXEC SQL CALL func(:refcur);" format returns an invalid ref cursor variable, resulting in a subsequent FETCH failing with ORA-01002 "fetch out of sequence".

If the anonymous block format is used instead, this works ok:

EXEC SQL EXECUTE
  BEGIN
    func(:refcur);
  END;
END-EXEC;

Cause

To view full details, sign in with your My Oracle Support account.

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


In this Document
Symptoms
Cause
Solution
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.