Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Stored Procedure to Get Admin Users and Other Users

767018May 10 2010 — edited May 11 2010
Hey,

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
This post has been answered by Frank Kulash on May 10 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 8 2010
Added on May 10 2010
13 comments
1,605 views