Solved

Getting name of user's group from Sybase.

Posted on 2013-06-13
8
2,773 Views
Last Modified: 2013-07-09
In Sybase ASE 12.5 we have users in groups.  I need a select statement that will give me the name of the user's group based on the suid.  Can this be done and if so how?
0
Comment
Question by:Amzngmoe
  • 3
  • 2
8 Comments
 
LVL 14

Accepted Solution

by:
Jan_Franek earned 500 total points
Comment Utility
select u2.name
from sysusers u1, sysusers u2
where u1.suid = suser_id()
and u1.gid = u2.uid
0
 

Author Comment

by:Amzngmoe
Comment Utility
This gave me a list of the users that are in a particular group.  I actually needed the name of the group.  I noticed that the actual group names are in the same table but have an suid of -2.  I just asked for the name where suid < 0 and that gave the name of the group.  Thank you.
0
 

Author Comment

by:Amzngmoe
Comment Utility
I've requested that this question be closed as follows:

Accepted answer: 0 points for Amzngmoe's comment #a39293814

for the following reason:

I had to alter the provided solution of the expert who commented to actually get what I needed.
0
 
LVL 14

Expert Comment

by:Jan_Franek
Comment Utility
My query gives you requested result. You have probably mistyped last part. If you use "and u1.gid = u2.gid", you will get the list of users in the group. But with correct "and u1.gid = u2.uid" you will get the group name.
0
 

Author Comment

by:Amzngmoe
Comment Utility
That is fine. I just wanted a solution. Don't really care about the points.  The commenter can have them.  I copied and pasted the commenter's code so there was no mistyping. I didn't mark that as the solution because others looking at this question need to know that there is another step to actually get the name of the group.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now