Page 1 of 1

problem with pay element

Posted: Mon Sep 14, 2009 7:30 am
by islamic_boy600
I add a pay element to the payroll , when i try to return the employee who take this element it take a long time with no result and this is the script

Code: Select all

SELECT PAA.FULL_NAME
FROM   PAY_ASSIGNMENT_ACTIONS_V PAA, PAY_RUN_RESULTS_V PRR 
WHERE  PAA.ASSIGNMENT_ACTION_ID = PRR.ASSIGNMENT_ACTION_ID
AND    PAA.Period_name = (select period_name from PER_TIME_PERIODS_V where payroll_id = 62 and 
       sysdate between start_date and end_date)

Posted: Mon Sep 14, 2009 8:33 am
by eng_ahmad_2007
Dear,

I still did not understand your question!
Do you mean the query is slow? or the query is not written correctly?

Also, what are you trying to achieve at the first place?

Regards,

Ahmad Ghanem

Posted: Mon Sep 14, 2009 1:22 pm
by islamic_boy600
Dear ahmed,

as you know in the saudi oraganziation there are many pay elements,
my oraganization add new element, they request areport that show the employees who take this element.

as i am new in developing in apps i make this script,the syntax is correct but take more than 20 minute iin executing with no result.

so can you advice me how to make this .

Regards

Mohamed Salah

Do you remember me?

Posted: Tue Sep 15, 2009 5:00 am
by eng_ahmad_2007
Dear Mohamed,

Tell me your requirement in details. If your requirement is to fetch the employee who recieved payment of a certain element payment within the current Payroll --> then, this query needs some modifications.

By the way, Do you know me? (No offense but I guess I do not regognize your name).

Best Regards,
Ahmad Ghanem

Posted: Tue Sep 15, 2009 7:27 am
by islamic_boy600
[quote]Dear Mohamed,

Tell me your requirement in details. If your requirement is to fetch the employee who recieved payment of a certain element payment within the current Payroll --> then, this query needs some modifications.

By the way, Do you know me? (No offense but I guess I do not regognize your name).

Best Regards,
Ahmad Ghanem


<i><div align="right">Originally posted by eng_ahmad_2007

Posted: Sat Sep 26, 2009 3:48 am
by islamic_boy600
any solution!!

Posted: Sat Sep 26, 2009 9:01 am
by islamic_boy600
i want to make aquery to use it in areport that display the following information:

ID Name Grade payment Deduction Amount

i use the following query but the RESULT_VALUE and the INPUT_VALUE_ID is the problem in this query becuase they are rows not column so the details of the person is displayed in more than one row

Code: Select all

Select paaf.PERSON_ID, papf.full_name, paaf.GRADE_ID,prrv.RESULT_VALUE,prrv.INPUT_VALUE_ID from per_grades pg,pay_element_entries_f peef,pay_run_result_values prrv,pay_run_results prr,per_all_assignments_f paaf,pay_element_types_f petf,per_all_people_f papf ,pay_payroll_actions ppa,pay_assignment_actions paa where prr.element_type_id = petf.element_type_id and paaf.GRADE_ID = pg.grade_id   and prrv.RUN_RESULT_ID = prr.RUN_RESULT_ID   and prr.element_entry_id = peef.element_entry_id   and peef.assignment_id = paaf.assignment_id   and papf.person_id = paaf.person_id   and petf.element_name =:elementname   and ppa.payroll_id =:payrollid   and paa.assignment_action_id = prr.assignment_action_id   and paa.payroll_action_id = ppa.payroll_action_id   and to_char(ppa.effective_date,'MON-YYYY') = to_char(trunc(sysdate),'MON-YYYY')   and sysdate between paaf.effective_start_date and paaf.effective_end_date   and sysdate between peef.effective_start_date and peef.effective_end_date   and sysdate between papf.effective_start_date and papf.effective_end_date