hello and thanks for your usefull replay

 

the following function goes through foo table rows and fetch it to a variable 
rowtype using cursor

i need to use the variable of one of the column to be pased to another 
function... if result is null i need to do insert and delete on tables if 
result is not null i need the function to continue loop through the rest of 
rows. untill the rows are finished.

 

the function tw if it is not null it adds value to the table foo... how i can 
make the loop updated automaticlly so the function c5c will continue run untill 
the table foo is emptey 

 

Kind regards

 

ihab

 

CREATE OR REPLACE FUNCTION c5c()RETURNS boolean AS'
  
declare

mycursor cursor for select *from foo;

pre foo%rowtype;

begin 
open mycursor; 
loop
fetch mycursor into pre;
exit when not found;
if select from tw(pre.fooid) is null then
insert into end(id) select id from foo where id=pre.fooid;
delete from foo(id) select id from foo where id=pre.fooid;
end if;
end loop;

close mycursor;
return true;
end;
'  LANGUAGE 'plpgsql' 


_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to