Christian_Boeck_57

How to gather all objects from a specific folder via SQL

Discussion created by Christian_Boeck_57 on Feb 22, 2017
Client = 1, Folder = Playground this select is for MS SQL:

WITH FolderHierarchy ( NAME, OTYPE, IDNR ) AS (
     SELECT OH_NAME, OH_OTYPE, OH_IDNR from OH
     where OH_Client = 1 and OH_Name like '%\PLAYGROUND'
     UNION ALL
     SELECT OH_NAME, OH_OTYPE, OH_IDNR
     from FolderHierarchy
     inner join OFS on IDNR = OFS_OH_Idnr_F
     inner join OH on OFS_OH_Idnr_O = OH_Idnr
) select * from FolderHierarchy;


Outcomes