title: passing cursor values into another function
body: <p>*i have a function which will delete the rows in the table for the given input id, the input is given to the function by another cursor_function.* </p>
  
  <pre><code>select * from t1;  
   id | col1    
  ----+-------  
    1 | user1  
    2 | user2  
    3 | user3  
    4 | user4  
    5 | user5   
  (5 rows)  
  
  create or replace function del_t1(int) returns void as $$  
  declare  
  a alias for $1;  
  begin  
  delete from t1 where id = a;  
  return;  
  end;  
  $$language plpgsql;  
  
  
  create or replace function del_cur(ref refcursor) returns void as $$  
  declare   
  a int;  
  begin  
  open ref scroll for select id from t1 where id &gt; 3 order by id desc;  
  fetch first from ref into a;  
  perform del_t1(a);  
  loop  
  a := 0;  
  fetch next from ref into a;  
  perform del_t1(a);  
  if (a=0) then  
  exit;  
  end if;  
  end loop;  
  end;  
  $$ language plpgsql;  
  </code></pre>
  
  <p><em>when the function is executed,</em>   </p>
  
  <pre><code>postgres# select del_cur('t1');  
  </code></pre>
  
  <p><em>it shows no error, no outputs, cursor just blinks, plz help me to solve this, this is small description of my big database tables, i need a cursor function which will pass its values one by one to another function.</em>  </p>