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 > How does one retrieve user table privileges via sql?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-13-03, 16:57
DoomDog DoomDog is offline
Registered User
 
Join Date: Mar 2003
Location: Palmer, Alaska USA
Posts: 13
Question How does one retrieve user table privileges via sql?

I want to be able to retrieve user table privileges
via sql for particular database tables (for web page
display) and I assume that somewhere within the
sysmaster schema this data exists. I am, however,
having great difficulties in figuring out how to get
at this data. Does anyone know what table(s) to look
in and what flag(s), if any, are needed?

TIA!
Marty
__________________
Don't take my word for it ... trial and error is my methodology (mostly error)...and then I forget and go thru it all again!
Reply With Quote
  #2 (permalink)  
Old 08-14-03, 07:07
nikhilbhave nikhilbhave is offline
Registered User
 
Join Date: Aug 2003
Location: India
Posts: 4
Re: How does one retrieve user table privileges via sql?

Quote:
Originally posted by DoomDog
I want to be able to retrieve user table privileges
via sql for particular database tables (for web page
display) and I assume that somewhere within the
sysmaster schema this data exists. I am, however,
having great difficulties in figuring out how to get
at this data. Does anyone know what table(s) to look
in and what flag(s), if any, are needed?

TIA!
Marty
===========================
Hi,

Try this query.

select st.tabname,st.owner, sa.tabauth,sa.grantor,sa.grantee
from systabauth sa, systables st
where sa.tabid=st.tabid and st.tabname='{tablename}';

replace {tablename} with the table name you want to see the privileges.

sa.tabauth will give an output like su-idx-- or s-------

each represents
s - Select
u - Update
* - Column level authority
i - Insert
d - Delete
x - Index
a - Alter
r - References

If the tabauth privilege code is uppercase (for example, S for select), a user who has this privilege can grant it to others. If the tabauth privilege code is lowercase (for example, s for select), the user who has this privilege cannot grant it to others.

Regards,

Niks
Reply With Quote
  #3 (permalink)  
Old 08-14-03, 10:23
DoomDog DoomDog is offline
Registered User
 
Join Date: Mar 2003
Location: Palmer, Alaska USA
Posts: 13
Smile

Niks, thank you for the reply! Your code works great, too!

Marty
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