If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > How to access the Sequence created in other Schema

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-06-12, 04:06
VTEST VTEST is offline
Registered User
 
Join Date: Jan 2012
Posts: 4
How to access the Sequence created in other Schema

Hi,

I have created a table with sequence in one schema. I want to access the table from another schema. While i trying to insert new row into that table Oracle giving error message 'ErrorError(61,12): PL/SQL: ORA-02289: sequence does not exist '.

Can you help me to overcome this problem? I am using Oracle 11g.

Thanks in advance....
Reply With Quote
  #2 (permalink)  
Old 02-06-12, 04:09
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,408
You need to grant the select privilege to that user.
Code:
GRANT SELECT ON your_sequence TO the_other_user
Reply With Quote
  #3 (permalink)  
Old 02-06-12, 04:47
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,629
Then, you'd reference it using owner's name or, alternatively, create a synonym in your own schema.

Option 1:
Code:
select owner.seq_name.nextval from dual
Option 2:
Code:
create synonym my_seq_name for owner.seq_name;

select my_seq_name.nextval from dual
Reply With Quote
  #4 (permalink)  
Old 02-06-12, 05:34
VTEST VTEST is offline
Registered User
 
Join Date: Jan 2012
Posts: 4
I have created new synonym and gave Grant access. Now its working fine.

Thank you very much for your reply...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On