Solved

Getting name of user's group from Sybase.

Posted on 2013-06-13
8
3,280 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
ID: 39247232
select u2.name
from sysusers u1, sysusers u2
where u1.suid = suser_id()
and u1.gid = u2.uid
0
 

Author Comment

by:Amzngmoe
ID: 39293814
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
ID: 39295726
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
ID: 39295727
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
ID: 39296377
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

One of the biggest threats in the cyber realm pertains to advanced persistent threats (APTs). This paper is a compare and contrast of Russian and Chinese APT's.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

786 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