|
怎么附件不能上传上来啊.算了直接贴上来了.
SELECT hou.organization_id, r.responsibility_id, r.application_id resp_application_id, mp.organization_code, hout.name organization_name, hou.business_group_id, gsob.set_of_books_id, gsob.chart_of_accounts_id, hoi1.org_information2 inventory_enabled_flag
FROM hr_all_organization_units hou, hr_all_organization_units_tl hout,
hr_organization_information hoi1, hr_organization_information hoi2,
mtl_parameters mp, gl_sets_of_books gsob, fnd_responsibility r
WHERE hou.organization_id = hoi1.organization_id
AND hou.organization_id = hoi2.organization_id
AND hou.organization_id = mp.organization_id
AND hoi1.org_information1 = 'INV'
AND hoi1.org_information2 = 'Y'
AND (hoi1.org_information_context || '') = 'CLASS'
AND (hoi2.org_information_context || '') = 'Accounting Information'
AND TO_NUMBER(DECODE(trim(translate(hoi2.org_information1,'0123456789',' ')), NULL, hoi2.org_information1, '-99999')) = gsob.set_of_books_id
AND NVL(hou.date_to, SYSDATE+1) >= Sysdate
AND Decode(hr_security.view_all ,'Y' , 'TRUE',
hr_security.show_record('HR_ALL_ORGANIZATION_UNITS',hout.organization_id))='TRUE'
AND Decode(hr_general.get_xbg_profile,'Y', hou.business_group_id ,
hr_general.get_business_group_id) = hou.business_group_id
AND hou.organization_id = hout.organization_id
AND hout.LANGUAGE = USERENV('LANG')
AND (EXISTS
(SELECT NULL
FROM org_access a1
WHERE a1.organization_id = hou.organization_id
AND NVL(a1.disable_date, SYSDATE+1) >= SYSDATE
AND a1.resp_application_id = r.application_id
AND a1.responsibility_id = r.responsibility_id)
OR NOT EXISTS
SELECT NULL FROM org_access a2 |
|