Object statistics wildcard makes it easier to list objects

A small enhancement to the Object Statistics table function in the latest round of Technology Refreshes is going to make it easier for me to get the results I want. Previously if I wanted to get the results for a group of objects I would have to ask the table function for a list of all the objects in the library, and then limit the returned results only to the ones I want using a where clause.

SELECT OBJNAME,OBJTYPE,OBJATTRIBUTE
FROM TABLE(QSYS2.OBJECT_STATISTICS(
OBJECT_SCHEMA => ‘MYLIB’,
OBJTYPELIST => ‘*ALL’,
OBJECT_NAME => ‘*ALL’))
WHERE OBJNAME LIKE ‘TEST%’
ORDER BY OBJTYPE,OBJNAME ;

I am sure you can appreciate that this is not the most efficient way to get the results I want, a list of objects that start with the letters: TEST. I have had to return the results of all the objects in the library MYLIB, and then select from that list the rows I want, where the name start with TEST.

Read more »

Verified by MonsterInsights