DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Loops in Scripts

  1. #1
    Join Date
    Mar 2001
    Posts
    82
    Hi all,

    How do you loop in scripts??

    I want to grant privileges to several users. Can I use a script to loop through the users, or do I have to do it manually? I could use a role, but then we have the same problem. How do I grant a role to several users?

    Thanks

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    You can use SQL generating SQL to acomplish this task. Creat a query from dba_tables and construct your grants. For example:
    Code:
    select 'grant select on ' || t.table_name || ' to ' || u.username || ';' 
    from user_tables t, dba_users u
    Jeff Hunter

  3. #3
    Join Date
    Mar 2001
    Posts
    82
    Thank you for your reply.

Posting Permissions

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


Click Here to Expand Forum to Full Width