platform Delphi 7 on windows 2000, sp4., database sybase asa 9.
i have a payroll processing program that does some lengthy processing on employees, using stored procedures, the design is that on button click, select a query of all employees and then pass varibles of an employee to different procedures that do different computations on values in a database. the problem is that if a try to enhance a procedure e.g. add another function so that they are more than 23 procedures i get an error, some variables are not found. but when they are just 23 procedures all variables are found and the program loops through all records, e.g. 200 employees. is there a way of doing this lengthy processing, and not busting the memory, or the resource governor in the database. any help will be appreciated,
Joseph Fuchaka. Nairobi.
with qryAllEmployees do begin
close;
sql.Clear;
sql.Add('SELECT employee_id, employee_no, company_id, first_name, last_name FROM employees WHERE company_id=:company_id');
parameters.ParamByName('company_id').Value:=get_company_id(ComboBoxCompany.Text);
Open;
end;//with
Gauge1.MaxValue:=qryAllEmployees.RecordCount;
ProgressCircle1.MaxValue:=23;
qryAllEmployees.First;
while not qryAllEmployees.Eof do begin
year_descr:=trim(ComboBoxYear.Text);
month_descr:=trim(ComboBoxMonth.Text);
employee_id:=qryAllEmployeesemployee_id.Value;
ProgressCircle1.StepBy(1);
basic_salary:=get_basic_salary(employee_id); // step 1
non_taxable_benefits:=get_non_taxable_benefits(employee_id);
ProgressCircle1.StepBy(1);//step 2
update_emp_monthly_salaries(employee_id, year_descr, month_descr,
basic_salary, non_taxable_benefits);//step 3
ProgressCircle1.StepBy(1);//step 3
insert_value_of_quaters(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//Step 4
calculate_gross_pay(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//Step 5
calculate_e1(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//Step 6
calculate_e2_and_e3(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 7
calculate_f(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 8
calculate_g(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 9
calculate_h(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 10
calculate_j(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 11
calculate_k(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 12
calculate_l(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 13
calculate_nhif(