Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Sequence exists but not accessible from script

Re: Sequence exists but not accessible from script

From: Robert Klemme <shortcutter_at_googlemail.com>
Date: Thu, 25 Jan 2007 17:55:07 +0100
Message-ID: <51s5muF1l39q0U1@mid.individual.net>


On 25.01.2007 17:31, David McNelis wrote:
> Good morning,

Good afternoon!
;-)

> I'm hoping someone can help me out with a problem I'm having. I've
> created a sequence, and the public synonym for the sequence.
>
> In a PL/SQL script I have the following line:
>
> SELECT sequencename.nextval into l_seqNum FROM dual;
>
> When the script runs I get the following:
> ERROR at line 47:
> ORA-06550: line 47, column 11:
> PL/SQL: ORA-02289: sequence does not exist
> ORA-06550: line 47, column 4:
> PL/SQL: SQL Statement ignored
>
> However, when I run the same statement from the SQL prompt outside of
> the script it works fine:
> SELECT sequencename.nextval FROM dual;
>
> Is there any reason why the sequence would be accessible outside of my
> script, but not inside? I'm running the script as the same user I run
> the working statement from.

Do you execute both with different users? You may have to use a fully qualified name, i.e. including the schema / user name.

Regards

        robert Received on Thu Jan 25 2007 - 10:55:07 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US