假設海波龍中的應用名稱為“A”,則以下方法可獲取組織主資料及層級結構:
SELECT ES.ITEMID ENTITY_ID,
t.LABEL ENTITY_CODE,
DS.DESCRIPTION ENTITY_DESC,
ES.Parentid PARENT_ID,
IC.LABEL PARENT_CODE,
DC.DESCRIPTION PARENT_DESC
FROM HFM.A_entity_layout ES, --組織主資料層級結構(含“共享”組織)
HFM.A_ENTITY_ITEM t,--組織主資料層級結構(不含“共享”組織)
HFM.A_ENTITY_DESC DS,--組織主資料名稱資訊
HFM.A_ENTITY_ITEM IC,
HFM.A_ENTITY_DESC DC
where es.itemid = t.itemid
and es.itemid = ds.itemid
and es.parentid = ic.itemid
and es.parentid = dc.itemid
and ds.languageid = 0
and dc.languageid = 0