Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2003
    Location
    Atlanta
    Posts
    134

    Talking Unanswered: Granting user permissions

    I have a database where 'public' has all permissions in the database.
    However I would like to grant only 'select' permissions on the tables in the database to a 'user1'. How do I do this with just one command line?

    I know 'grant select on <table> to 'user1' does this but it has to be repeated for all the tables and I do not want to this way.

    Please suggest a better command I can use once at the database level for the user to grant 'select' permissions.

    Thanks

  2. #2
    Join Date
    Aug 2002
    Location
    Bonn/Germany
    Posts
    152
    Try this meta SQL statement:


    output to "grant_select.sql" without headings
    select "grant select on " || trim(st.tablename) || " to user1;"
    from systables st
    where tabid > 99
    and tabtype = "T";

    Best regards

    Eric
    --
    IT-Consulting Herber
    WWW: http://www.herber-consulting.de
    Email: eric@herber-consulting.de

    ***********************************************
    Download the IFMX Database-Monitor for free at:
    http://www.herber-consulting.de/BusyBee
    ***********************************************

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •