Re: newbie syntax question

From: DA Morgan <damorgan_at_psoug.org>
Date: Mon, 03 Mar 2008 08:46:33 -0800
Message-ID: <1204562792.872387@bubbleator.drizzle.com>


brock wade wrote:
> Thanks to anyone with any clues here as to what could be wrong with my
> code, I'm totally new to Oracle!
>
> In my Oracle Package Body (Package compiles fine) I'm getting an error
> on this line of code saying: "ORA-02289: sequence does not exist":
>
> select usr_id_s1.nextval into pUSER_id from dual;
>
> Here is the complete stored procedure:
>
> Procedure UserSecurityAdd(pUSER_login in users_t1.usr_login
> %type,
> pUSER_lname in users_t1.usr_lname
> %type,
> pUSER_fname in users_t1.usr_fname
> %type,
> pUSER_mi in users_t1.usr_mi%type,
> pUSER_pcd_view in users_t1.usr_pcd_view
> %type,
> pUSER_emp_id in users_t1.usr_emp_id
> %type,
> pRowsAffected out number) is
>
> begin
> select usr_id_s1.nextval into pUSER_id from dual;
> insert into users_t1
> ( usr_emp_id,
> usr_login,
> usr_lname,
> usr_fname,
> usr_mi,
> usr_pcd_view)
> values
> ( pUSER_emp_id,
> pUSER_login,
> pUSER_lname,
> pUSER_fname,
> pUSER_mi,
> pUSER_pcd_view);
>
> commit;
> pRowsAffected := sql%rowcount;
> end UserSecurityAdd;

You are asking a sequence "s1" to provide you with the next value.  From the standpoint of your session it does not exist. Meaning either it was never created or you do not have privileges to access it.

-- 
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Mon Mar 03 2008 - 10:46:33 CST

Original text of this message