Hi,
I have problem passing variable in a FOR LOOP. Following is my code.
Any help much appreciated.
ZS
-- Procedure teta has two parameters l and q , l is the feature table and q is the quality table
create or replace procedure teta(l varchar2,q varchar2)
is
-- a string variable vst is declared to store the SQL statement
Declare
vst VARCHAR2(2000);
begin
-- An SQL statement which performs a non-spatial join of feature table and quality table
vst := 'SELECT a.fid m,a.geometry,b.vacc n FROM ' ||l||
' a, ' ||q|| ' b where a.fid=b.qid ';
-- Dynamic Sql execution
execute immediate vst;
-- A loop is needed as the query returns more than one record
FOR rec IN (vst)
LOOP
-- output statement to print the values of fid and positional accuracy
DBMS_OUTPUT.PUT_LINE(rec.m || ', ' || rec.n);
END LOOP;
end teta;
/