× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I'm trying this out in interactive SQL and can't seem to find the qsys2/users table. Is it only available for embedded SQL?
Quite often I need to search if an employee has an ID on the IBM i and this could be handy. Right now we create a file of user profiles each week but if this file is there it would work too.
Right now I use a statement like this on our file of users:
SELECT * FROM qgpl/userfile WHERE upper(uptext) like '%DAVE%'

Any questions, let me know please.

Thanks,

Dave B

Everybody is ignorant, only on different subjects. - Will Rogers


-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of darren@xxxxxxxxx
Sent: Thursday, October 08, 2015 10:27 AM
To: RPG programming on the IBM i (AS/400 and iSeries) <rpg400-l@xxxxxxxxxxxx>
Subject: Re: AW: Retrieve a user's full name (not the User ID)

I was amazed by this function, but confused because I hadn't seen it before. I went looking for it in a reference chart I have from IBM online, and I didn't find this table function, but I did find the QSYS2.USER_INFO view. This view seems more restrictive by my authority to this data, possibly because there are a lot of fields in there. This QSYS2.USER() table function returns more results, possibly because the name of the user isn't subject to tight profile controls. I find that interesting.

IBM Provided an UDTF (User Defined Function) named USERS(), located
within
the QSYS2 library.
You easily can access this UDTF with (embedded) SQL:

Exec SQL Select ODOBTX into :HostVariable
from Table(Qsys2.Users()) x
Where ODOBNM = :HostUsrPrf;




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.