How to use revoke and grant in sql commands
my question is that how to use revoke and grant in sql commands
SQL> select * from student2;
NAME ROLLNO CLASS
-------------------- ---------- ----------
satish 1 10
suresh 2 10
srikanth 3 10
SQL> grant select on student2 to satish;
grant select on student2 to satish
*
ERROR at line 1:
ORA-01917: user or role 'SATISH' does not exist
SQL> revoke update on student2 from satish;
revoke update on student2 from satish
*
ERROR at line 1:
ORA-01917: user or role 'SATISH' does not exist
above r the commands i used regarding revoke and grant,but i got errors,can any body help me.
Re: How to use revoke and grant in sql commands
"grant select on student2 to satish"
Here, satish should be a sql user having rights on the database, which contains student2 table. It seems that satish exists only in student2 table as data, not actual windows/sql user . So first create a user in windows, if u use windows authentication, or in sql server, then grant that user rights on the db which contains student2 table. Now the above command should work!!!
Re: How to use revoke and grant in sql commands
Try this..
grant select on sutdent2 to satish;
revoke select on student2 from satish;
Re: How to use revoke and grant in sql commands
The problem is beacuse the user satish does not exist. You will need to either create a new uesr named Satish or a role named Satish for your GRANT and REVOKE to work
Re: How to use revoke and grant in sql commands
Hi frnd,
This is some thing like syntax for ur questn...
Grant select on object_name to user_name;
Revoke select on object_name from user_name;