I can display my IBM i session library list by running the DSPLIBL
command from the command line. However, I want to get it in my SQLRPGLE
program using SQL query.
Is there any SQL query that I can use or any file which keeps my session library list information so that I can query that file to get this information.
You can query an IBM DB2 catalog table
LIBRARY_LIST_INFO
available in theQSYS2
library on the IBM i system to get your session library list information using SQL. Just run this query and you will get your result:select listagg(sys_name,',') from qsys2.library_list_info
Here, I am using the
LISTAGG
aggregate function to concatenate values from multiple rows into a single string with a comma separator between the values.