Solved

Getting name of user's group from Sybase.

Posted on 2013-06-13
8
3,705 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
We have put together a white paper that aims to explain how MSPs can both improve their offering and ease the pain of after-hours service by: -Suggesting changes to workflow -Indicating how to rework policy to suit your team -Providing ConnectW…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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