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 08:56:49 -0800
Message-ID: <1169744208.992572.102790@v45g2000cwv.googlegroups.com>


I can post an excerpt from it (have a feeling the client would prefer I not post the entire script)....however I think I left out one piece of information. I've got a dblink set up. My script works fine on the db on which the sequence was originally created, but not on other database.

I did create the sequence using the syntax "create public synonym email_seq for david.email_seq_at_prodlink.domain.com"

Here is the excerpt from my script....

select 'replaceemail-' || email_seq.nextval || '@domain.com' into l_email from dual;

When I run that exact statement (less the "into l_email") it works fine.

Thanks for your help.

On Jan 25, 10:41 am, "gazzag" <gar..._at_jamms.org> wrote:
> On 25 Jan, 16:31, "David McNelis" <dmcne..._at_gmail.com> wrote:
>
>
>
> > 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;
>
> > 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.
>
> > Any help is appreciated.
>
> > David McNelisHmmmm... I smell a typo. Can you post the exact script your running,
> please?
>
> HTH
>
> -g
Received on Thu Jan 25 2007 - 10:56:49 CST

Original text of this message

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