If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Granting user permissions

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-25-03, 10:59
vkaramched vkaramched is offline
Registered User
 
Join Date: Jan 2003
Location: Atlanta
Posts: 134
Talking 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
Reply With Quote
  #2 (permalink)  
Old 07-25-03, 11:18
eherber eherber is offline
Registered User
 
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
***********************************************
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On