首页 > 代码库 > 查询法人实体

查询法人实体

SELECT a.set_of_books_id ledger_id,
gl.name ledger_name,
gl.currency_code,
ffv.flex_value ou_code,
a.name ou_name,
a.organization_id,
a.default_legal_context_id,
b.flex_segment_value,
ffv.flex_value company_code,
ffv.description company_name
FROM hr_operating_units a,
gl_legal_entities_bsvs b,
fnd_flex_values_vl ffv,
fnd_flex_value_sets ffs,
gl_ledgers gl
WHERE a.default_legal_context_id = b.legal_entity_id
AND b.flex_segment_value = http://www.mamicode.com/ffv.flex_value
AND ffv.flex_value_set_id = ffs.flex_value_set_id
 AND ffs.flex_value_set_name = &company_value_set_name
AND a.set_of_books_id = gl.ledger_id;

SELECT hou.set_of_books_id AS ledger_id,
hou.organization_id,
hou.name AS ou_name,
xep.legal_entity_id AS legal_id,
xep.legal_entity_identifier AS legal_code,
xep.name AS legal_name
FROM hr_operating_units hou, xle_entity_profiles xep
WHERE hou.set_of_books_id = &p_ledger_id
AND hou.default_legal_context_id = xep.legal_entity_id
ORDER BY xep.legal_entity_identifier;

查询法人实体