Path to multiple files is like this in the IFS (file system)
/Folder1/Folder2/Folder3/Folder4/File1.jpg
I want with sql in DB2 get the IBM IFS path like this sense Folder3 has all the folders I want.
Folder4/File1.jpg
I have tested with this sql code in DB2
SELECT CAST(PATH_NAME AS CHAR(100))
FROM TABLE(QSYS2.IFS_OBJECT_STATISTICS(START_PATH_NAME => '/Folder1/Folder2/Folder3'))
WHERE OBJECT_TYPE = '*STMF'
ORDER BY PATH_NAME ;
But the result I get is
/Folder1/Folder2/Folder3/Folder4/File1.jpg
How can I change my query to list the lowest folder and the file in that folder. I don’t want to have Folder1/Folder2/Folder3 in my result.
I don’t get any error.
FreeYourMind is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.