List Info

Thread: lost variables




lost variables
country flaguser name
United States
2007-02-05 23:17:02

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(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 14
calculate_nssf(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 15
calculate_sacco_deductions(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 16
calculate_other_deductions(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 17
insert_non_taxable_earnings(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 18
calculate_variable_deductions(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 19
calculate_salary_arrears(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 20
insert_pensions(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 21
calculate_net_pay(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 22
fill_bank_details(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 23
fill_employee_details(employee_id, year_descr, month_descr);
//application.ProcessMessages;
qryAllEmployees.Next;
Gauge1.Progress:=Gauge1.Progress + 1;
end;
//preparation of payroll complete
// process_loans;
ShowMessage('batch processing complete !');


---------------------------------
Have a burning question? Go to Yahoo! Answers and get answers from real people who know.

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
Re: lost variables
country flaguser name
United States
2007-02-06 01:34:07

You try to use a trigger on table who execute all step ?

Regards,

Adrian POPA

joseph fuchaka < jfuchakab%40yahoo.com">jfuchakabyahoo.com> wrote:
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(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 14
calculate_nssf(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 15
calculate_sacco_deductions(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 16
calculate_other_deductions(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 17
insert_non_taxable_earnings(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 18
calculate_variable_deductions(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 19
calculate_salary_arrears(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 20
insert_pensions(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 21
calculate_net_pay(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 22
fill_bank_details(employee_id, year_descr, month_descr);
ProgressCircle1.StepBy(1);//step 23
fill_employee_details(employee_id, year_descr, month_descr);
//application.ProcessMessages;
qryAllEmployees.Next;
Gauge1.Progress:=Gauge1.Progress + 1;
end;
//preparation of payroll complete
// process_loans;
ShowMessage('batch processing complete !');

---------------------------------
Have a burning question? Go to Yahoo! Answers and get answers from real people who know.

[Non-text portions of this message have been removed]

---------------------------------
Looking for earth-friendly autos?
Browse Top Cars by "Green Rating&quot; at Yahoo! Autos' Green Center.

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
Re: lost variables
country flaguser name
United States
2007-02-06 09:40:18

It seems to me that if you were running out of
resources, you would see an error indicating that.
Have you tried running each procedure in it's own
button (just as a test)?

Dave

--- joseph fuchaka < jfuchakab%40yahoo.com">jfuchakabyahoo.com> wrote:

> 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
&gt; procedures, the design is that on button click,
&gt; 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
&gt; close;
&gt; sql.Clear;
> sql.Add('SELECT employee_id, employee_no,
> company_id, first_name, last_name FROM employees
> WHERE company_id=:company_id');
&gt;
>
parameters.ParamByName('company_id').Value:=get_company_id(ComboBoxCompany.Text);
> Open;
&gt; end;//with
> Gauge1.MaxValue:=qryAllEmployees.RecordCount;
> ProgressCircle1.MaxValue:=23;
> qryAllEmployees.First;
> while not qryAllEmployees.Eof do begin
&gt; year_descr:=trim(ComboBoxYear.Text);
&gt; month_descr:=trim(ComboBoxMonth.Text);
> employee_id:=qryAllEmployeesemployee_id.Value;
&gt; ProgressCircle1.StepBy(1);
&gt; 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,
&gt; 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(employee_id, year_descr,
> month_descr);
> ProgressCircle1.StepBy(1);//step 14
> calculate_nssf(employee_id, year_descr,
> month_descr);
> ProgressCircle1.StepBy(1);//step 15
> calculate_sacco_deductions(employee_id,
> year_descr, month_descr);
> ProgressCircle1.StepBy(1);//step 16
> calculate_other_deductions(employee_id,
> year_descr, month_descr);
> ProgressCircle1.StepBy(1);//step 17
> insert_non_taxable_earnings(employee_id,
> year_descr, month_descr);
> ProgressCircle1.StepBy(1);//step 18
> calculate_variable_deductions(employee_id,
> year_descr, month_descr);
> ProgressCircle1.StepBy(1);//step 19
> calculate_salary_arrears(employee_id,
&gt; year_descr, month_descr);
> ProgressCircle1.StepBy(1);//step 20
> insert_pensions(employee_id, year_descr,
> month_descr);
> ProgressCircle1.StepBy(1);//step 21
> calculate_net_pay(employee_id, year_descr,
> month_descr);
> ProgressCircle1.StepBy(1);//step 22
> fill_bank_details(employee_id, year_descr,
> month_descr);
> ProgressCircle1.StepBy(1);//step 23
> fill_employee_details(employee_id, year_descr,
> month_descr);
> //application.ProcessMessages;
> qryAllEmployees.Next;
> Gauge1.Progress:=Gauge1.Progress + 1;
> end;
>; //preparation of payroll complete
> // process_loans;
> ShowMessage('batch processing complete !');
>;
>
>
>
>
> ---------------------------------
> Have a burning question? Go to Yahoo! Answers and
> get answers from real people who know.
&gt;
> [Non-text portions of this message have been
>; removed]
>
>

__________________________________________________________
Get your own web address.
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL

__._,_.___
.

__,_._,___
RE: lost variables
country flaguser name
United States
2007-02-06 10:12:41

Hello Joseph!

-----Original Message-----
From: delphi-en%40yahoogroups.com">delphi-enyahoogroups.com [mailto: delphi-en%40yahoogroups.com">delphi-enyahoogroups.com] On
Behalf Of joseph fuchaka

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.
>>&gt;>>&gt;>>>>>;>>&gt;>>>>>;>>&gt;
Chances are your code is becoming unmanageable because the variables are
setup in different spots within different procedures. I would recommend
creating an global object to hold all your variables and then create a
procedure to load all the variables before you start calling all your
subroutines. By centralizing your data and then having all your
procedures reference this one location, you should avoid losing your
data.

Other than that, be careful to not duplicate work just because you have
created a procedure to do something. For example, if you are
calculating federal taxes, and state taxes, you may see that you are
doing similar tasks but referencing different tables (Fed tables, State
Tables). You may find it easier to break down the work into functions
that do things and then call them inside your main subroutines that
handle distinct tasks.

Good Luck!

Tom Nesler
Live long!... Code Well!... and Prosper!... V

__._,_.___
.

__,_._,___
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )