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: David McNelis <dmcnelis_at_gmail.com>
Date: 25 Jan 2007 09:32:00 -0800
Message-ID: <1169746320.630568.18210@a75g2000cwd.googlegroups.com>


Well then, that certainly clears that issue up. Thank you very much Lothar, and everyone that helped.

On Jan 25, 11:16 am, lothar.armbrues..._at_t-online.de (Lothar Armbrüster) wrote:
> "David McNelis" <dmcne..._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.armbrues..._at_t-online.de
> Hauptstr. 26 |
> 65346 Eltville |
Received on Thu Jan 25 2007 - 11:32:00 CST

Original text of this message

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