|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: 141: 142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153: 154: 155: 156: 157: 158: |
)--drop table temp_fis
--/
truncate table temp_fis
/
--create table temp_fis as
insert into temp_fis
(select rownum id, a.* from
(
SELECT aptc.description fis_payment_type, sp.service_provider_number fis_provider_id,
TRIM(UPPER(sp.service_provider_name)) fis_provider_name, apl.person_id fis_person_id,
TRIM(UPPER(pn.first_name)) fis_person_fname, TRIM(UPPER(pn.last_name)) fis_person_lname,
pix.person_id sa_person_id, TRIM(UPPER(pn.first_name))||' '||TRIM(UPPER(pn.last_name)) fis_person_name,
SUM(apl.line_amount) fis_amount, apl.add_date fis_rec_cre_dt
FROM ap_pl_line@fprd apl, person_names@factprd pn, ap_person_id_xref@cfsprd pix,
service_providers@fprd sp, ap_pl_type_ctl@fprd aptc
WHERE apl.person_id = pn.person_id
AND pn.primary_name_flag = 'Y'
AND apl.person_id = pix.fis_person_id(+)
AND apl.service_provider_id = sp.service_provider_id
AND apl.pl_type_id = aptc.payroll_type_id
AND apl.pl_type_id = 1 /* 1 for FCM */
AND apl.pl_expense_id IS NULL
AND TRUNC(apl.from_date) >= TO_DATE('&begin_date', 'MM/DD/YYYY')
AND TRUNC(apl.TO_DATE) <= TO_DATE('&end_date', 'MM/DD/YYYY')
GROUP BY aptc.description, sp.service_provider_number, TRIM(UPPER(sp.service_provider_name)),
apl.person_id, pix.person_id, TRIM(UPPER(pn.first_name)), TRIM(UPPER(pn.last_name)),
TRIM(UPPER(pn.first_name))||' '||TRIM(UPPER(pn.last_name)), apl.add_date
ORDER BY aptc.description, TRIM(UPPER(pn.first_name))||' '||TRIM(UPPER(pn.last_name))
) a)
/
commit
/
/*
drop table temp_merged
/
create table temp_merged as
(select
f.id,
f.fis_payment_type,
f.fis_provider_id,
f.fis_provider_name,
f.fis_person_id,
f.fis_person_fname,
f.fis_person_lname,
f.sac_person_id,
f.fis_person_name,
f.fis_amount,
f.fis_rec_cre_dt,
s.id s_id,
s.sa_payment_type,
s.sa_provider_id,
s.sa_provider_name,
s.sa_person_fname,
s.sa_person_lname,
s.sa_person_id s_sa_person_id,
s.sa_person_name,
s.sa_amount,
s.sa_rec_cre_dt
from temp_fis_fcm f, temp_sa_fcm s
where f.id = s.id
and rownum < 1)
/
*/
truncate table temp_merged
/
insert into temp_merged
(select
id,
fis_payment_type,
fis_provider_id,
fis_provider_name,
fis_person_id,
fis_person_fname,
fis_person_lname,
sa_person_id,
fis_person_name,
fis_amount,
fis_rec_cre_dt,
null s_id,
null sa_payment_type,
null sa_provider_id,
null sa_provider_name,
null sa_person_fname,
null sa_person_lname,
null s_sa_person_id,
null sa_person_name,
null sa_amount,
null sa_rec_cre_dt
from temp_fis)
/
commit
/
declare
v_person_id number;
v_lname varchar2(35);
v_fname varchar2(35);
v_amount number;
v_exists number;
v_processed boolean;
cursor get_m_pmt is
select * from temp_merged
--where fis_person_id = 0102001090507007
order by sa_person_id, fis_amount desc;
cursor get_s_pmt (p_person_id number, p_lname varchar2, p_fname varchar2, p_amount number) is
select * from temp_sa
where (sac_person_id = p_person_id
or (sa_person_lname = p_lname and sac_person_fname = p_fname))
and (sa_amount = nvl(p_amount,sa_amount));
s get_s_pmt%rowtype;
begin
for m in get_m_pmt loop
v_processed := false;
for s in get_s_pmt (m.sa_person_id,m.fis_person_lname,m.fis_person_fname,m.fis_amount) loop
select count(1) into v_exists from temp_merged t where t.s_id = s.id;
if v_exists = 0 then
v_processed := true;
-- dbms_output.put_line('upd 1, id: '||m.id);
update temp_merged set
s_id = s.id,
sa_payment_type = s.sa_payment_type,
sa_provider_id = s.sa_provider_id,
sa_provider_name = s.sa_provider_name,
sa_person_fname = s.sa_person_fname,
sa_person_lname = s.sa_person_lname,
s_sa_person_id = s.sa_person_id,
sa_person_name = s.sa_person_name,
sa_amount = s.sa_amount,
sa_rec_cre_dt = s.sa_rec_cre_dt
where id = m.id;
exit;
end if;
end loop;
if not v_processed then
for s in get_s_pmt (m.sa_person_id,m.fis_person_lname,m.fis_person_fname,null) loop
select count(1) into v_exists from temp_merged t where t.s_id = s.id;
if v_exists = 0 then
-- dbms_output.put_line('upd 2, id: '||m.id);
update temp_merged set
s_id = s.id,
sa_payment_type = s.sa_payment_type,
sa_provider_id = s.sa_provider_id,
sa_provider_name = s.sa_provider_name,
sa_person_fname = s.sa_person_fname,
sa_person_lname = s.sa_person_lname,
s_sa_person_id = s.sa_person_id,
sa_person_name = s.sa_person_name,
sa_amount = s.sac_amount,
sa_rec_cre_dt = s.sa_rec_cre_dt
where id = m.id;
exit;
end if;
end loop;
end if;
if mod(m.id,100) = 0 then commit; end if;
end loop;
commit;
end;
/
|
Advertisement
| Hall of Fame |