Stored Procedure to Get Admin Users and Other Users
767018May 10 2010 — edited May 11 2010Hey,
I am new to stored procedures in Oracle and would really appreciate the help! I have two tables:
Users_
ID USERNAME - PARENT_GROUP - IS_ADMIN
---------------------------------------
1 jsmith - 1 - 0
2 brogerson - 1 - 1
3 jloren - 2 - 0
Groups*
ID - GROUPNAME
-----------------------------------------
1 - ITUsers
2 - AcctUsers
I would like to create a procedure that accepts a users username and returns every user in their group and the user id, or if the user is marked IS_ADMIN, I want the procedure to return all users in all groups.
How would I do this? Ideally I would like to funnel the result into a DataGridView in C#.
Thank you in advance,
Jeffrey Kevin Pry
Edited by: jeffrey.pry on May 10, 2010 10:42 AM
Edited by: jeffrey.pry on May 10, 2010 10:43 AM