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

    From Robert Rock@ocrlr2000@gmail.com to comp.sys.ibm.as400.misc on Thu Oct 29 18:02:44 2020
    From Newsgroup: comp.sys.ibm.as400.misc

    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
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Jonathan Bailey@jonathan.bailey@tesco.net to comp.sys.ibm.as400.misc on Mon Nov 2 06:10:06 2020
    From Newsgroup: comp.sys.ibm.as400.misc

    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
    --- Synchronet 3.21d-Linux NewsLink 1.2