Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sequence exists but not accessible from script
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