Subject | Loop Problems and referencing to other tables |
---|---|
Author | KURSAT TASKIN |
Post date | 2001-12-10T08:11:08Z |
Hi,
create procedure summation (variable integer)
as
declare variable sum numeric(15,2);
begin
*/ Suppose I have two tables, Table1(T1) and Table2 (T2), and 5 fields in
all tables, F1, F2, F3, F4, F5/*
Select sum(F1) from T1 where T1.F2=variable into :sum;
*/ Then I want to chek second table's second field (T2.F2) and for those
records which value is equal to variable (i.e. for all records that
T2.F2=:variable) I want to set the T2.F3 column with the value sum(T1.F1)/*
For this the following loop is not excepted.
While T2.F2=:variable do
begin
set T2.F3=:sum
end
suspend;
end
I thing there is someting wrong with my codation, But I do not know where is
the error.
Also I do not know how to reference the the other tables in a stored
procedur
Kursat
create procedure summation (variable integer)
as
declare variable sum numeric(15,2);
begin
*/ Suppose I have two tables, Table1(T1) and Table2 (T2), and 5 fields in
all tables, F1, F2, F3, F4, F5/*
Select sum(F1) from T1 where T1.F2=variable into :sum;
*/ Then I want to chek second table's second field (T2.F2) and for those
records which value is equal to variable (i.e. for all records that
T2.F2=:variable) I want to set the T2.F3 column with the value sum(T1.F1)/*
For this the following loop is not excepted.
While T2.F2=:variable do
begin
set T2.F3=:sum
end
suspend;
end
I thing there is someting wrong with my codation, But I do not know where is
the error.
Also I do not know how to reference the the other tables in a stored
procedur
Kursat