• SQL to retreive every library that contains characters 'xyz'

    From Robert Rock@21:1/5 to All on Thu Oct 29 18:02:44 2020
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jonathan Bailey@21:1/5 to Robert Rock on Mon Nov 2 06:10:06 2020
    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.

    On Friday, 30 October 2020 at 01:02:47 UTC, Robert Rock wrote:
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)