Hi
I have a problem.
I have two tables...table1 and table2.
table1 has the column latitude and sno(serial number) and table2 has the column lat and sno(serial number) .
i have to find the difference of all the values in column latitude from table 1 with all the values in column lat from table 2 and place it in a new table result having column difference
i have written this code but i am getting error as missing elements. Can anyone please guide me?
[code=oracle]
DECLARE
NO INTEGER :=1;
NUM INTEGER :=1;
BEGIN
for no in 1..10 loop
for Num in 1..10 loop
insert into result (difference) select (select T1.latitude from table1 T1 where sno=no - select T2.table2 from table2 T2 where sno=Num ) from table1 T1, table2 T2 ;
end loop;
end loop;
END;[/code]
Please help me in debugging this....
thanks a lot
Ashwini
I have a problem.
I have two tables...table1 and table2.
table1 has the column latitude and sno(serial number) and table2 has the column lat and sno(serial number) .
i have to find the difference of all the values in column latitude from table 1 with all the values in column lat from table 2 and place it in a new table result having column difference
i have written this code but i am getting error as missing elements. Can anyone please guide me?
[code=oracle]
DECLARE
NO INTEGER :=1;
NUM INTEGER :=1;
BEGIN
for no in 1..10 loop
for Num in 1..10 loop
insert into result (difference) select (select T1.latitude from table1 T1 where sno=no - select T2.table2 from table2 T2 where sno=Num ) from table1 T1, table2 T2 ;
end loop;
end loop;
END;[/code]
Please help me in debugging this....
thanks a lot
Ashwini
Comment