oracle ebs r12 合同模块取销售人员信息

select papf.last_name
from okc_contacts_v okc,
jtf.jtf_rs_salesreps rs,
jtf_rs_resource_extns_tl jt,
okc_k_party_roles_v okv,
jtf_rs_resource_extns je,
per_all_people_f papf
where rs.salesrep_id = okc.OBJECT1_ID1
and okv.ID = okc.CPL_ID
and okv.RLE_CODE = 'SHIP_FROM'
and okv.CHR_ID = p_header_id----合同ID参数
and rs.person_id = papf.person_id
and nvl(papf.effective_start_date, sysdate - 1) <= sysdate
and nvl(papf.effective_end_date, sysdate + 1) >= sysdate
and rs.resource_id = jt.resource_id
and jt.resource_id = je.resource_id
and jt.language = userenv('LANG')
and je.category = jt.category

posted @ 2013-10-17 14:47  文涛武略  阅读(911)  评论(0编辑  收藏  举报