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: Lothar Armbrüster <lothar.armbruester_at_t-online.de>
Date: Thu, 25 Jan 2007 18:16:02 +0100
Message-ID: <87hcufowml.fsf@prometeus.none.local>


"David McNelis" <dmcnelis_at_gmail.com> writes:

> Good morning,
>
> 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;
>

[...]

Hello David,

I suppose the execution rights for the sequence are granted to the user via a role. Privileges granted via a role aren't used in PL/SQL. You have to grant the privileges directly to the user to have them work in PL/SQL.

Hope that helps,
Lothar

-- 
Lothar Armbrüster  | lothar.armbruester_at_t-online.de
Hauptstr. 26       |
65346 Eltville     |
Received on Thu Jan 25 2007 - 11:16:02 CST

Original text of this message

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