Discussion:
SQL to retreive every library that contains characters 'xyz'
(too old to reply)
Robert Rock
2020-10-30 01:02:44 UTC
Permalink
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
2020-11-02 14:10:06 UTC
Permalink
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.
Post by Robert Rock
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
Loading...