Results 1 to 5 of 5

Thread: How to use revoke and grant in sql commands

  1. #1
    Junior Member
    Join Date
    Apr 2007
    Answers
    1

    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.


  2. #2
    Contributing Member
    Join Date
    Apr 2007
    Answers
    58

    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!!!

    Regards,
    Anoop :)
    If its useful, dont forget to [COLOR="Red"]THANK[/COLOR] me :cool:

  3. #3
    Junior Member
    Join Date
    Oct 2008
    Answers
    11

    Re: How to use revoke and grant in sql commands

    Try this..
    grant select on sutdent2 to satish;
    revoke select on student2 from satish;


  4. #4
    Expert Member
    Join Date
    Nov 2008
    Answers
    300

    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


  5. #5
    Contributing Member
    Join Date
    Dec 2008
    Answers
    76

    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;


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact