Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQL to retreive every library that contains characters 'xyz'

41 views
Skip to first unread message

Robert Rock

unread,
Oct 29, 2020, 9:02:47 PM10/29/20
to
Hello,

Thank you for your assistance. As you can see I don't know too much about SQL, but what am I doing wrong? Try to get all libraries that have 'xyz in the name. XYZ is an example of course.

SELECT OBJNAME FROM TABLE (QSYS2.OBJECT_STATISTICS('*ALL','*LIB') ) AS X
JOB_STATUS_FILTER => '*LIB' )) X
where job_name like '%xyz';

Thank you very much for your assistance,

Robert Rock

Jonathan Bailey

unread,
Nov 2, 2020, 9:10:09 AM11/2/20
to
2 issues:
The 2nd line seems to be inserted from elsewhere.
job_name is the name of your job running the sql, it should be objname.

Try the post a few down from here
select * from qsys2.sysschemas where schema_name like'%XYZ%'

The % are wildcards so library WXYZA needs them both to match. Also XYZ must be uppercase.

HTH
Jonathan.
0 new messages