Home » RDBMS Server » Server Administration » Using a Grant Sequence
Using a Grant Sequence [message #374066] Wed, 23 May 2001 10:00 Go to next message
Fidias
Messages: 1
Registered: May 2001
Junior Member
Iīm trying to grant a sequence to another user but when this user run the aplication that use it, this one dosenīt work.

This are the sql commands that I use to grant the sequence and later query if exist on the privileges of the user that I grantee, BUT IT DOSENīT.

1. grant all privileges on SEQ_NAME to USER_NAME
Note: I connect with the owner of the sequence.

2. Select * from SYS.ALL_OBJECTS
Where owner = 'USER_NAME'
and Object_type = 'SEQUENCE'

I donīt know if the sequence are unique for each user,
if anyone knows please reply this message or can tell me something that can helme.
Q [message #374067 is a reply to message #374066] Wed, 23 May 2001 12:39 Go to previous messageGo to next message
Bala
Messages: 205
Registered: November 1999
Senior Member
Hi,

basically the otheruser should give the sequece name with qualifier.
For instance
you have two users
seq_owner and seq_user.

SQL> connect seq_owner/seq_owner_pw@db1
connected

SQL> create sequence myseq;
Sequence created.

SQL> grant select, alter on myseq to seq_user;
granted.

SQL> connect seq_user/seq_user_pw@db1
connected.

SQL> select myseq.nextval from dual;
*
ERROR at line 1:
ORA-02289: sequence does not exist

but if qualify

SQL> select seq_owner.myseq.nextval from dual;

NEXTVAL
-------
1

if you dont want to give the qualifier
then create a synonym from the seq_user schema.
SQL> create synonym myseq for seq_owner.myseq;

Sequence created.

now you can select from the myseq with out giving the qualifier.

SQL> select myseq.nextval from dual;

NEXTVAL
-------
2

Bala.
Re: Using a Grant Sequence [message #374200 is a reply to message #374066] Wed, 30 May 2001 04:07 Go to previous message
Zakk
Messages: 5
Registered: May 2001
Junior Member
i dont know, but just by giving him the privileges doesnt make him the owner of the sequence. that is the problem with ur 2nd query
Previous Topic: How to retrieve the month from a date ?
Next Topic: wanna print emp name and manager under which he is working..
Goto Forum:
  


Current Time: Mon Jul 01 03:50:41 CDT 2024