A Sequence Prefixed by Schema Name Fails With PLS-00302: component 'SEQUENCE_NAME' must be declared (Doc ID 1371201.1)

Last updated on JULY 05, 2017

Applies to:

PL/SQL - Version: 10.2.0.4 to 11.2.0.3 - Release: 10.2 to 11.2
Information in this document applies to any platform.

Symptoms

  A sequence with a schema name qualified fails in a pl/sql block with
PLS-00302: component 'SEQUENCE_NAME' must be declared

Example

DECLARE
   l_number  NUMBER := 0;
BEGIN
   SELECT SCOTT.MY_SEQ.NEXTVAL
   INTO l_number
   FROM dual;
   DBMS_OUTPUT.PUT_LINE(L_NUMBER);
END;

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